@enonic-types/lib-auth 7.15.0-A1 → 7.15.0-B1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/auth.d.ts +10 -4
  2. package/package.json +2 -2
package/auth.d.ts CHANGED
@@ -25,6 +25,12 @@ export interface LoginParams {
25
25
  scope?: LoginScopeType;
26
26
  sessionTimeout?: number;
27
27
  }
28
+ export interface LoginWithoutPasswordParams {
29
+ user: string;
30
+ idProvider?: string;
31
+ scope?: LoginScopeType;
32
+ sessionTimeout?: number;
33
+ }
28
34
  export interface LoginResult {
29
35
  authenticated: boolean;
30
36
  message?: string;
@@ -44,7 +50,7 @@ export interface LoginResult {
44
50
  * @param {number} [params.sessionTimeout] Session timeout (in seconds). By default, the value of session.timeout from com.enonic.xp.web.jetty.cfg
45
51
  * @returns {LoginResult} Information for logged-in user.
46
52
  */
47
- export declare function login(params: LoginParams): LoginResult;
53
+ export declare function login(params: LoginParams | LoginWithoutPasswordParams): LoginResult;
48
54
  /**
49
55
  * Logout an already logged-in user.
50
56
  *
@@ -79,16 +85,16 @@ export declare function hasRole(role: string): boolean;
79
85
  export declare function generatePassword(): string;
80
86
  export interface ChangePasswordParams {
81
87
  userKey: string;
82
- password: string;
88
+ password?: string | null;
83
89
  }
84
90
  /**
85
- * Changes password for specified user.
91
+ * Changes or clears password for specified user.
86
92
  *
87
93
  * @example-ref examples/auth/changePassword.js
88
94
  *
89
95
  * @param {object} params JSON parameters.
90
96
  * @param {string} params.userKey Key for user to change password.
91
- * @param {string} params.password New password to set.
97
+ * @param {string} [params.password] The new password to set. If the value is null, the password will be cleared.
92
98
  */
93
99
  export declare function changePassword(params: ChangePasswordParams): void;
94
100
  export declare function getPrincipal(userKey: UserKey): User | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/lib-auth",
3
- "version": "7.15.0-A1",
3
+ "version": "7.15.0-B1",
4
4
  "description": "Type definitions for lib-auth.",
5
5
  "types": "auth.d.ts",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/enonic/xp/tree/master#readme",
29
29
  "dependencies": {
30
- "@enonic-types/core": "7.15.0-A1"
30
+ "@enonic-types/core": "7.15.0-B1"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"