-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add routing from settings -> reset password
- Loading branch information
1 parent
b197335
commit ab4c668
Showing
2 changed files
with
9 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
'use client' | ||
|
||
import { useRouter } from 'next/navigation'; | ||
import supabase from '../../api/supabase/createClient'; | ||
|
||
export default function Settings() { | ||
const { push } = useRouter(); | ||
const signOut = async () => { | ||
const { error } = await supabase.auth.signOut() | ||
if (error) { | ||
throw new Error(`An error occurred trying to sign out: ${error}`); | ||
} | ||
push("/login"); | ||
} | ||
const resetPassword = async () => { | ||
const e = '[email protected]' // pull email from profiles | ||
const url = 'http://example.com/account/update-password' | ||
await supabase.auth.resetPasswordForEmail(e, { | ||
redirectTo: url, | ||
}) | ||
const resetPassword = () => { | ||
push("/reset-password"); | ||
} | ||
|
||
return ( | ||
|