File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,14 @@ function AuthCallbackContent() {
1414 "loading" ,
1515 ) ;
1616 const [ message , setMessage ] = useState ( "" ) ;
17+ const [ isProcessing , setIsProcessing ] = useState ( false ) ;
1718
1819 useEffect ( ( ) => {
1920 const handleCallback = async ( ) => {
21+ // Prevent multiple simultaneous executions
22+ if ( isProcessing ) return ;
23+ setIsProcessing ( true ) ;
24+
2025 try {
2126 // Check if this is an OAuth callback
2227 const success = searchParams . get ( "success" ) ;
@@ -67,11 +72,14 @@ function AuthCallbackContent() {
6772 "An error occurred during authentication. Please try again." ,
6873 ) ;
6974 setTimeout ( ( ) => router . push ( "/" ) , 3000 ) ;
75+ } finally {
76+ setIsProcessing ( false ) ;
7077 }
7178 } ;
7279
7380 handleCallback ( ) ;
74- } , [ router , searchParams , refreshUser ] ) ;
81+ // eslint-disable-next-line react-hooks/exhaustive-deps
82+ } , [ searchParams ] ) ;
7583
7684 if ( status === "loading" ) {
7785 return (
You can’t perform that action at this time.
0 commit comments