For 3 days I no longer understand why redirects with Google Auth on React Native do not work at all. I saw people asking the problem but the solutions do not work for me. Please help me.
// ... code
const oauthProvider = { google: OAuthProvider.Google, apple: OAuthProvider.Apple, }[provider.toLowerCase()];
TypeScript
if (!oauthProvider) {
throw new Error(`Unsupported provider: ${provider}`);
}
const redirectSuccessUri = Linking.createURL("/");
const redirectFailureUri = Linking.createURL("/error");
const response = account.createOAuth2Token(
oauthProvider,
redirectSuccessUri,
redirectFailureUri
);
if (!response) {
throw new Error("Response is undefined");
}
// ... code
TL;DR
Developers are having trouble getting Google OAuth redirects to work in React Native, even after trying various solutions found online.
One potential solution to fix the issue could be to ensure that the redirectSuccessUri and redirectFailureUri are correctly specified and matching the expected values on the Google API side. Double-checking the implementation details and configuration of OAuthProvider.Google could also help in resolving the problem.Recommended threads
- Register Disable
this is possible disable register but keep oauth login?
- how to access the value of account statu...
- Redirect from clicking team invite link ...
Hi all! Pretty new to app development in general so this might be something more generic than appwrite, but I've found (after reading the docs for the Teams API...