cercio
cercio
BABetter Auth
Created by cercio on 12/29/2024 in #help
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",
});
};
7 replies
BABetter Auth
Created by cercio on 12/28/2024 in #help
TypeError: Response body object should not be disturbed or locked
No description
19 replies