File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 1
1
"use client"
2
2
3
- // import Link from 'next/link';
4
- import { useRouter } from 'next/navigation' ;
5
3
import { useState } from 'react' ;
4
+ import { useRouter } from 'next/navigation' ;
6
5
import supabase from '../../api/supabase/createClient' ;
7
6
8
-
9
-
10
-
11
7
export default function ResetPassword ( ) {
12
8
const [ newPassword , setPassword ] = useState ( '' ) ;
13
9
const { push } = useRouter ( ) ;
Original file line number Diff line number Diff line change 1
1
'use client'
2
2
3
+ import { useRouter } from 'next/navigation' ;
3
4
import supabase from '../../api/supabase/createClient' ;
4
5
5
6
export default function Settings ( ) {
7
+ const { push } = useRouter ( ) ;
6
8
const signOut = async ( ) => {
7
9
const { error } = await supabase . auth . signOut ( )
10
+ if ( error ) {
11
+ throw new Error ( `An error occurred trying to sign out: ${ error } ` ) ;
12
+ }
13
+ push ( "/login" ) ;
8
14
}
9
- const resetPassword = async ( ) => {
10
- const e = '[email protected] ' // pull email from profiles
11
- const url = 'http://example.com/account/update-password'
12
- await supabase . auth . resetPasswordForEmail ( e , {
13
- redirectTo : url ,
14
- } )
15
+ const resetPassword = ( ) => {
16
+ push ( "/reset-password" ) ;
15
17
}
16
18
17
19
return (
You can’t perform that action at this time.
0 commit comments