docs: added docs for reset password (#9306)
- Added to docs on implementing auth flows using the module and API routes how to update a user's password - Added guide on how to send a notification when a password token is generated - Added a guide on implementing reset password flow in storefront - Added OAS for the `/update` and `/reset-password` routes + generated specs for the API reference
This commit is contained in:
@@ -8,7 +8,7 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
In this document, you'll learn how to use the Auth Module's main service's methods to implement an authentication flow.
|
||||
In this document, you'll learn how to use the Auth Module's main service's methods to implement authentication flows and reset a user's password.
|
||||
|
||||
## Authentication Methods
|
||||
|
||||
@@ -149,3 +149,32 @@ if (success) {
|
||||
If the returned `success` property is `true`, the authentication with the third-party provider was successful.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Reset Password
|
||||
|
||||
To update a user's password or other authentication details, use the `updateProvider` method of the Auth Module's main service. It calls the `update` method of the specified authentication provider.
|
||||
|
||||
For example:
|
||||
|
||||
```ts
|
||||
const { success } = await authModuleService.update(
|
||||
"emailpass",
|
||||
// passed to the auth provider
|
||||
{
|
||||
email: "user@example.com",
|
||||
password: "supersecret",
|
||||
}
|
||||
)
|
||||
|
||||
if (success) {
|
||||
// password reset successfully
|
||||
}
|
||||
```
|
||||
|
||||
The method accepts as a first parameter the ID of the provider, and as a second parameter the data necessary to reset the password.
|
||||
|
||||
In the example above, you use the `emailpass` provider, so you have to pass an object having an `email` and `password` properties.
|
||||
|
||||
If the returned `success` property is `true`, the password has reset successfully.
|
||||
Reference in New Issue
Block a user