File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export const FetchAuth = {
38
38
const res = await fetch ( url , options ) ;
39
39
if ( ! res . ok ) {
40
40
console . log ( res ) ;
41
- throw Error ( ) ;
41
+ // throw Error();
42
42
}
43
43
return res ;
44
44
} ,
Original file line number Diff line number Diff line change @@ -10,17 +10,25 @@ import {
10
10
import useLogin from "../hooks/useLogin" ;
11
11
import { message } from "antd" ;
12
12
import { useMutation } from "@tanstack/react-query" ;
13
+ import { getAuth , signOut } from "firebase/auth" ;
14
+ import { useRouter } from "next/navigation" ;
13
15
14
16
const SettingPage = ( ) => {
15
17
const user = useLogin ( ) ;
18
+ const router = useRouter ( ) ;
16
19
17
20
const deleteProfileMutation = useMutation ( async ( ) => deleteProfileUrl ( ) , {
18
21
onSuccess : ( ) => {
19
22
closeModal ( "delete_modal" ) ;
20
23
api . open ( {
21
24
type : "success" ,
22
- content : "Successfully deleted profile!" ,
25
+ content : "Successfully deleted profile! Logging you out... " ,
23
26
} ) ;
27
+ const auth = getAuth ( ) ;
28
+ setTimeout ( ( ) => {
29
+ signOut ( auth ) ;
30
+ router . push ( "/" ) ;
31
+ } , 2000 ) ;
24
32
} ,
25
33
onError : ( e ) => {
26
34
api . open ( {
You can’t perform that action at this time.
0 commit comments