diff --git a/src/pages/App/handlers/WebViewLoginHandler/WebViewLoginHandler.tsx b/src/pages/App/handlers/WebViewLoginHandler/WebViewLoginHandler.tsx index fa316fd7a9..f108608ebd 100644 --- a/src/pages/App/handlers/WebViewLoginHandler/WebViewLoginHandler.tsx +++ b/src/pages/App/handlers/WebViewLoginHandler/WebViewLoginHandler.tsx @@ -5,18 +5,20 @@ import { history } from "@/shared/appConfig"; import { WebviewActions } from "@/shared/constants"; import { FirebaseCredentials } from "@/shared/interfaces/FirebaseCredentials"; import { getInboxPagePath } from "@/shared/utils"; +import firebase from "@/shared/utils/firebase"; import { parseJson } from "@/shared/utils/json"; const WebViewLoginHandler: FC = () => { const dispatch = useDispatch(); - const handleWebviewLogin = React.useCallback((event) => { + const handleWebviewLogin = React.useCallback(async (event) => { const data = parseJson(event.data) as FirebaseCredentials; + const user = await firebase.auth().currentUser; if (data?.redirectUrl) { history.push(data?.redirectUrl); } - if (!data?.providerId) { + if (!data?.providerId || !!user) { return; }