mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Fix OAuth useEffect getting called twice
This commit is contained in:
1 file changed
+2
-1
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user