We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51ea4bc commit fce6644Copy full SHA for fce6644
client/src/components/OAuthCallback.tsx
@@ -1,10 +1,18 @@
1
-import { useEffect } from 'react';
+import { useEffect, useRef } from 'react';
2
import { handleOAuthCallback } from '../lib/auth';
3
import { SESSION_KEYS } from '../lib/constants';
4
5
const OAuthCallback = () => {
6
+ const hasProcessedRef = useRef(false);
7
+
8
useEffect(() => {
9
const handleCallback = async () => {
10
+ // Skip if we've already processed this callback
11
+ if (hasProcessedRef.current) {
12
+ return;
13
+ }
14
+ hasProcessedRef.current = true;
15
16
const params = new URLSearchParams(window.location.search);
17
const code = params.get('code');
18
const serverUrl = sessionStorage.getItem(SESSION_KEYS.SERVER_URL);
0 commit comments