File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1346,7 +1346,7 @@ export const linkGoogleAccount = async (
13461346) : Promise < { success : boolean ; data ?: GoogleLinkResponse ; error ?: string } > => {
13471347 try {
13481348 const accessToken = getAccessToken ( ) ;
1349- const response = await authFetch ( '/api/auth/google/link' , {
1349+ const response = await fetch ( '/api/auth/google/link' , {
13501350 method : 'POST' ,
13511351 headers : {
13521352 'Content-Type' : 'application/json' ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export function GoogleCallbackPage() {
1515 const isProcessed = useRef ( false ) ;
1616
1717 useEffect ( ( ) => {
18+ if ( isProcessed . current ) return ;
1819 const handleCallback = async ( ) => {
1920 const code = searchParams . get ( 'code' ) ;
2021 const state = searchParams . get ( 'state' ) ;
@@ -46,10 +47,9 @@ export function GoogleCallbackPage() {
4647 return ;
4748 }
4849
49- isProcessed . current = true ;
50-
5150 const redirectUri = `${ window . location . origin } /auth/google/callback` ;
5251
52+ isProcessed . current = true ;
5353 try {
5454 if ( pkceData . mode === 'link' ) {
5555 const result = await linkGoogleAccount ( code , pkceData . codeVerifier , redirectUri ) ;
You can’t perform that action at this time.
0 commit comments