Skip to content

Commit c5ae7f5

Browse files
committed
restore and reset passord
1 parent 8b310d0 commit c5ae7f5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/api/auth.js

+12
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,16 @@ export default class Auth {
9595
logout() {
9696
return this.api.post(endpoints.logout);
9797
}
98+
99+
// @method restorePassword(email: String): Promise
100+
// requests email instructions to reset password
101+
restorePassword(email) {
102+
return this.api.post(endpoints.sendRestPassword, { email });
103+
}
104+
105+
// @method restorePassword(code: String, newPassword: String): Promise
106+
// creates new password
107+
resetPassword(code, newPassword) {
108+
return this.api.post(endpoints.resetPassword, { code, newPassword });
109+
}
98110
}

src/endpoints.js

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export const login = '/v1/public/login';
66
export const signup ='/v1/public/registrations/new';
77
export const googleSignin = '/v1/public/signin/google/customer';
88
export const logout = '/v1/public/logout';
9+
export const sendRestPassword = '/v1/public/send-password-reset';
10+
export const resetPassword = '/v1/public/reset-password';
911

1012
// product endpoints
1113
export const search = `/search/products_catalog_view/_search?size=${MAX_RESULTS}`;

0 commit comments

Comments
 (0)