Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃獰 馃悰 Fix duplicate createUser calls on signup #21454

Merged
merged 8 commits into from
Jan 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions airbyte-webapp/src/packages/cloud/services/auth/AuthService.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { User as FirebaseUser } from "firebase/auth";
import React, { useCallback, useContext, useEffect, useMemo, useRef } from "react";
import React, { useCallback, useContext, useMemo, useRef } from "react";
import { useQueryClient } from "react-query";
import { useEffectOnce } from "react-use";
import { Observable, Subject } from "rxjs";
Expand Down Expand Up @@ -160,23 +160,6 @@ export const AuthenticationProvider: React.FC<React.PropsWithChildren<unknown>>
});
});

useEffect(() => {
const onFocus = async () => {
return auth.onAuthStateChanged(async (currentUser) => {
if (!currentUser) {
loggedOut();
} else {
await onAfterAuth(currentUser);
}
});
};

window.addEventListener("focus", onFocus);
return () => {
window.removeEventListener("focus", onFocus);
};
}, [auth, loggedOut, onAfterAuth]);

const queryClient = useQueryClient();

const ctx: AuthContextApi = useMemo(
Expand Down