From 4443ec9c845bd3e4bfcefb14046fc8c4331e9a0c Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sun, 24 Jan 2021 18:56:10 +0100 Subject: [PATCH] add password reset. --- svelte-ui/src/clients/amplify.ts | 8 ++++ svelte-ui/src/forms/LoginForm.svelte | 55 +++++++++++++++++++++------- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/svelte-ui/src/clients/amplify.ts b/svelte-ui/src/clients/amplify.ts index 94774b4..cc60726 100644 --- a/svelte-ui/src/clients/amplify.ts +++ b/svelte-ui/src/clients/amplify.ts @@ -19,6 +19,14 @@ export async function signOut(): Promise { await Auth.signOut(); } +export async function forgotPassword(username: string): Promise { + const res = await Auth.forgotPassword(username); +} + +export async function forgotPasswordSubmit(username: string, code: string, password: string): Promise { + await Auth.forgotPasswordSubmit(username, code, password); +} + async function getAccessToken(): Promise { try { const u = await Auth.currentSession(); diff --git a/svelte-ui/src/forms/LoginForm.svelte b/svelte-ui/src/forms/LoginForm.svelte index 865c763..468386d 100644 --- a/svelte-ui/src/forms/LoginForm.svelte +++ b/svelte-ui/src/forms/LoginForm.svelte @@ -1,7 +1,7 @@