I’m creating a Google Sign-In flow using Expo / React Native. One caveat is that I’m not planning on integrating with Firebase. I’m also trying to build for the web.
I have my code working on ios and android when I build, and my code used to work on the web too. However, from the ExpoWebBrowser, I always get this error:
"Cross-Origin-Opener-Policy policy would block the window.close call." - ExpoWebBrowser.web.ts:28
I didn’t get this error at any point during testing. The only thing I had to do previously to make things work was add the “Authorized redirect URIs” and “Authorized JavaScript origins” in Google Cloud Console but those are both accurate and the error does not indicate that a mismatched URI is the problem.
I’ve also added custom schemas for the redirecting on mobile but I don’t think that should impact web.
For reference here is my code in the file:
import * as WebBrowser from "expo-web-browser";
import * as Google from "expo-auth-session/providers/google";
import * as AppleAuthentication from "expo-apple-authentication";
WebBrowser.maybeCompleteAuthSession();
export default function SignInPage() {
const [request, response, promptAsync] = Google.useIdTokenAuthRequest({
// my client IDs
});
useEffect(() => {
// do something with the response
}, [response]);
const onPressSignInWithGoogle = () => { promptAsync() }
return (
// containers and styles
<AppButton onPress={onPressSignInWithGoogle}/>
)
}
I’ve looked at Stack Overflow for a while but all the similar questions seem to involve Firebase integration. Also, I need to put these into a production site, so temporary dev solutions aren’t what I need. Thanks