![](https://cdn.discordapp.com/avatars/768658263046357072/0b558776cafea4a566eeddb003132c71.webp)
When authenticating with Google OAuth in react native, I'm getting the error 400 saying : There was an error processing your request. Please check the input and try again.
Type general_bad_request
is the anyway to fix this ??
![](https://cdn.discordapp.com/avatars/768658263046357072/0b558776cafea4a566eeddb003132c71.webp)
as on the following image.
and bellow is the code
export async function login() {
try {
// const redirectUri = Linking.createURL("*/");
// const failureUri = Linking.createURL("myapp://sign-in");
const redirectUri = Linking.createURL("myapp://redirect");
const failureUri = Linking.createURL("myapp://sign-in");
const response = await account.createOAuth2Token(
"google" as OAuthProvider.Google,
// OAuthProvider.Google,
redirectUri,
failureUri
);
if (!response) throw new Error("Create OAuth2 token failed 1");
const browserResult = await openAuthSessionAsync(
response.toString(),
redirectUri
);
console.log({ browserResult });
if (browserResult.type !== "success")
throw new Error("Create OAuth2 token failed 2");
const url = new URL(browserResult.url);
const secret = url.searchParams.get("secret")?.toString();
const userId = url.searchParams.get("userId")?.toString();
if (!secret || !userId) throw new Error("Create OAuth2 token failed");
const session = await account.createSession(userId, secret);
if (!session) throw new Error("Failed to create session");
return true;
} catch (error) {
console.error(error);
return false;
}
}
I've tried what worked before and new method but unseccessfull.
Please if there is someone with the solution, could you share >
![](https://cdn.discordapp.com/avatars/462046107556511744/504fd808296728e8e89d82b8ea1e77a9.webp)
Worked before? Oauth2 for react native isn't fully supported yet
Recommended threads
- [AppwriteException: Network request fail...
Hi there, I am trying to upload a picture to my storage in appwrite but it is giving me an error as titled. Here is my code: ```export const getFilePreviewYes ...
- Query relations
I have 3 tables in relation, but I only get all 3 back if I get the last one. Which is bad because I can only query by the first one. Expectation: Get the firs...
- Deep linking back to iOS/Android app fro...
Hey there, I have seen a few posts about this issue in this channel, but nobody just provides an easy way to do it. Is there boiler plate code for handling this...
![](/images/bgs/pre-footer.png)