@verdocs/js-sdk 3.9.2 → 3.9.4
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.
- package/Users/Auth.d.ts +19 -2
- package/Users/Auth.js +17 -0
- package/Users/Types.d.ts +1 -1
- package/package.json +1 -1
package/Users/Auth.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAuthenticateAppRequest, IAuthenticateUserRequest } from './Types';
|
|
2
|
-
import { TokenValidationRequest, UpdateEmailRequest,
|
|
2
|
+
import { TokenValidationRequest, UpdateEmailRequest, IUpdatePasswordRequest } from './Types';
|
|
3
3
|
import { IAuthenticateResponse, TokenValidationResponse, UpdateEmailResponse, UpdatePasswordResponse } from './Types';
|
|
4
4
|
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
5
5
|
/**
|
|
@@ -69,7 +69,24 @@ export declare const refreshTokens: (endpoint: VerdocsEndpoint) => Promise<IAuth
|
|
|
69
69
|
* }
|
|
70
70
|
* ```
|
|
71
71
|
*/
|
|
72
|
-
export declare const updatePassword: (endpoint: VerdocsEndpoint, params:
|
|
72
|
+
export declare const updatePassword: (endpoint: VerdocsEndpoint, params: IUpdatePasswordRequest) => Promise<UpdatePasswordResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Reset the caller's password.
|
|
75
|
+
*
|
|
76
|
+
* ```typescript
|
|
77
|
+
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
78
|
+
*
|
|
79
|
+
* const {success} = await Auth.resetPassword({ email });
|
|
80
|
+
* if (status !== 'OK') {
|
|
81
|
+
* window.alert(`Please check your email for instructions on how to reset your password.`);
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare const resetPassword: (endpoint: VerdocsEndpoint, params: {
|
|
86
|
+
email: string;
|
|
87
|
+
}) => Promise<{
|
|
88
|
+
success: boolean;
|
|
89
|
+
}>;
|
|
73
90
|
/**
|
|
74
91
|
* Update the caller's email address.
|
|
75
92
|
*
|
package/Users/Auth.js
CHANGED
|
@@ -86,6 +86,23 @@ export var updatePassword = function (endpoint, params) {
|
|
|
86
86
|
.put('/user/update_password', params)
|
|
87
87
|
.then(function (r) { return r.data; });
|
|
88
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* Reset the caller's password.
|
|
91
|
+
*
|
|
92
|
+
* ```typescript
|
|
93
|
+
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
94
|
+
*
|
|
95
|
+
* const {success} = await Auth.resetPassword({ email });
|
|
96
|
+
* if (status !== 'OK') {
|
|
97
|
+
* window.alert(`Please check your email for instructions on how to reset your password.`);
|
|
98
|
+
* }
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export var resetPassword = function (endpoint, params) {
|
|
102
|
+
return endpoint.api //
|
|
103
|
+
.post('/user/reset_password', params)
|
|
104
|
+
.then(function (r) { return r.data; });
|
|
105
|
+
};
|
|
89
106
|
/**
|
|
90
107
|
* Update the caller's email address.
|
|
91
108
|
*
|
package/Users/Types.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ export interface TokenValidationResponse {
|
|
|
128
128
|
/** The decoded and validated body of the JWT */
|
|
129
129
|
payload: any;
|
|
130
130
|
}
|
|
131
|
-
export interface
|
|
131
|
+
export interface IUpdatePasswordRequest {
|
|
132
132
|
email: string;
|
|
133
133
|
oldPassword: string;
|
|
134
134
|
newPassword: string;
|