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:
Frane Polić
2024-10-04 11:10:26 +02:00
committed by GitHub
parent b2a8c897f7
commit 0a2ecdc889
7 changed files with 401 additions and 5 deletions

View File

@@ -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") {