Expo session with google OAuth

I encounter this problem when trying to log with Google in my expo app. I have carefully follow the Expo integration. When first clicking the login with google button, here is the change of the session :
{"isPending": true, "session": null}
{"isPending": false, "session": null}
{"isPending": true, "session": null}
{"isPending": false, "session": null}
Even if the login is successful, it looks like the session state is never populated with the new one When clicking for the second time the button, here is the new change :
{"isPending": true, "session": null}
{"isPending": false, "session": {"session": {"createdAt":...
{"isPending": true, "session": null}
{"isPending": false, "session": {"session": {"createdAt":...
The session state is populated with the session from the previous login, because on the second attempt, i get the session updated even if i cancel the login. I don't know what is happening
export const authClient = createAuthClient({
baseURL: "http://localhost:3001" /* base url of your Better Auth backend. */,
plugins: [
expoClient({
scheme: "myapp",
storagePrefix: "myapp",
storage: SecureStore,
}),
],
});


const handleGoogleLogin = async () => {
await authClient.signIn.social({
provider: "google",
callbackURL: "/(app)/profile",
});
};
export const authClient = createAuthClient({
baseURL: "http://localhost:3001" /* base url of your Better Auth backend. */,
plugins: [
expoClient({
scheme: "myapp",
storagePrefix: "myapp",
storage: SecureStore,
}),
],
});


const handleGoogleLogin = async () => {
await authClient.signIn.social({
provider: "google",
callbackURL: "/(app)/profile",
});
};
5 Replies
Bart ⚡
Bart ⚡3mo ago
@cercio Did you manage to solve it?
cercio
cercioOP3mo ago
Still not...
Sulek
Sulek4d ago
Hey, any luck with this?
cercio
cercioOP4d ago
Hey, i don't have tried again but i can get back to you soon, i need to try it again with latest update. You face the same problem ?
Sulek
Sulek3d ago
Hi, sorry, no I have a different problem. I get this error on my phone after I select google email
No description

Did you find this page helpful?