feat(dashboard, js-sdk): reset password UI (#9451)
**What** - add password reset flow on Admin --- https://github.com/user-attachments/assets/3438ace2-c661-4121-a580-794a69ad4518 --- CLOSES CC-568 Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
@@ -95,6 +95,29 @@ export class Auth {
|
||||
this.client.clearToken()
|
||||
}
|
||||
|
||||
resetPassword = async (
|
||||
actor: string,
|
||||
provider: string,
|
||||
body: { identifier: string }
|
||||
) => {
|
||||
await this.client.fetch(`/auth/${actor}/${provider}/reset-password`, {
|
||||
method: "POST",
|
||||
body,
|
||||
headers: { accept: "text/plain" }, // 201 Created response
|
||||
})
|
||||
}
|
||||
|
||||
updateProvider = async (
|
||||
actor: string,
|
||||
provider: string,
|
||||
body: Record<string, unknown>
|
||||
) => {
|
||||
await this.client.fetch(`/auth/${actor}/${provider}/update`, {
|
||||
method: "POST",
|
||||
body,
|
||||
})
|
||||
}
|
||||
|
||||
private setToken_ = async (token: string) => {
|
||||
// By default we just set the token in the configured storage, if configured to use sessions we convert it into session storage instead.
|
||||
if (this.config?.auth?.type === "session") {
|
||||
|
||||
Reference in New Issue
Block a user