fix: sign-out redirect and Google OAuth user creation

- signOut() cleared the cookie but never navigated, leaving the user
  stuck on the current page — redirect to /login on success.
- better-auth's core "image" field had no matching Drizzle column
  (schema uses avatarUrl), so every OAuth signup threw
  BetterAuthError: unable_to_create_user, silently failing before a
  session was ever created. Remap via user.fields.image.
This commit is contained in:
Arnaud
2026-07-03 20:55:31 +02:00
parent 9412529120
commit c5bc2e1470
2 changed files with 17 additions and 2 deletions
+3
View File
@@ -100,6 +100,9 @@ export const auth = betterAuth({
},
user: {
fields: {
image: "avatarUrl",
},
additionalFields: {
role: {
type: "string",