resetPassword(email: string): Promise<TResponse | null>¶
The resetPassword
method allows to reset a password for a given user.
Input parameters¶
email¶
email
is a mandatory parameter of the string
type which represents an email address linked to an account that we want to remind password for.
Returned value¶
A returned value has a type of Promise<TResponse | null>
. You can read more about TResponse object here.
Example¶
In this example we make a AuthenticationApi
call to reset a password for a user.
useStorefront(async (storefront) => {
const authenticationApi = await storefront.getApi('AuthenticationApi');
await authenticationApi.resetPassword('email@example.com');
});
Authentication API methods reference¶
- selectAuthStatus$
- getAuthStatus
- selectIsAuthorized$
- isAuthorized
- login
- logout
- setLoginEmail
- getLoginEmail
- selectLoginEmail$
- register
- getAdditionalFieldsForRegistration
- openLoginModal
- closeLoginModal
- openRegisterModal
- closeRegisterModal
- openRemindPasswordModal
- closeRemindPasswordModal