Fix OAuth useEffect getting called twice

This commit is contained in:
Alex Gleason committed 2025-09-18 11:54:58 -05:00
1 parent 9ee120f765
commit 945bc002f2
1 file changed
+2 -1
+2 -1
View File
@@ -16,6 +16,7 @@ export default function GitHubOAuth() {
const state = searchParams.get('state');
const error = searchParams.get('error');
const errorDescription = searchParams.get('error_description');
const storedState = localStorage.getItem('github_oauth_state');
// Handle OAuth errors
if (error) {
@@ -29,7 +30,7 @@ export default function GitHubOAuth() {
}
// Handle successful OAuth callback
if (code && state) {
if (code && state && storedState) {
handleCallback(code, state).then((success) => {
if (success) {
toast({