diff --git a/src/routes/(admin)/account/(menu)/settings/change_password/+page.svelte b/src/routes/(admin)/account/(menu)/settings/change_password/+page.svelte index ba3dcdea..11c3741f 100644 --- a/src/routes/(admin)/account/(menu)/settings/change_password/+page.svelte +++ b/src/routes/(admin)/account/(menu)/settings/change_password/+page.svelte @@ -10,10 +10,16 @@ export let data let { session, supabase } = data + // True if definitely has a password, but can be false if they + // logged in with oAuth or email link let hasPassword = session?.user?.amr?.find((x) => x.method === "password") ? true : false + let usingOAuth = session?.user?.amr?.find((x) => x.method === "oauth") + ? true + : false + let sendBtn: HTMLButtonElement let sentEmail = false let sendForgotPassword = () => { @@ -36,7 +42,7 @@ Change Password -

Settings

+

Change Password

{#if hasPassword} {:else} -
- +
-
- You currently do not use a password to log in. -
-
- You use oAuth ("Sign in with Github" or similar). You can continue to - use your account using only oAuth if you like! -
+ {#if usingOAuth} +
Set Password By Email
+
+ You use oAuth to sign in ("Sign in with Github" or similar). You can + continue to access your account using only oAuth if you like! +
+ {:else} +
Change Password By Email
+ {/if}
- If you'd like to set a password to compliment your oAuth login, click - the button below. It will send you an email at {session?.user?.email} which - will allow you to set a password. + The button below will send you an email at {session?.user?.email} which will + allow you to set your password.