RugileOriginal post
React Developer
i was able to use google login on localhost, but when i swich to virtual andoid wtih eas build i get {"type":dismiss} from WebBrowser, wtf is happening. i created web profile and set Hostname to "*", code: `export const signInWithGoogle = async () => {
try {
const redirecting = Linking.createURL("google", {
scheme: "quizapp",
isTripleSlashed: false
});
const responseData = await account.createOAuth2Token(
OAuthProvider.Google,
redirecting
);
const res = await WebBrowser.openAuthSessionAsync(
responseData.toString(),
redirecting,
);
console.log("googleLogin", res)
if (res.type === "success") {
const data = parseUrl(res.url)
const secret = data?.query?.secret
const userId = data?.query?.userId
const ses = await account.createSession(userId, secret);
return { success: true, session: ses };
}
} catch (error) {
console.log(error);
return { success: false };
}
};`
Summary
Oauth2 is working on localhost but not on mobile, getting {"type":dismiss} error. The issue may be related to the redirect URL setting. To solve this, check the redirect URL settings and make sure it's configured correctly for mobile.