[GH-ISSUE #1066] After the upgrade, logging in and returning shows INVALID_ORIGIN. #8578

Closed
opened 2026-04-13 03:41:50 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @hellokaton on GitHub (Dec 30, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1066

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

I didn't make any changes, I just encountered this issue when upgrading from version 1.1.4 to version 1.1.6

Current vs. Expected behavior

/api/auth/callback/google?state=3_i8sWggoMcXSobH0Wbck5D81_f0nAph&code=4%2F0AanRRru7XcG2vj4tqW0w1Y5hhOSz2o2E4Q3GOKucPgp7La1OBn0nkq1WTmETen4Fwl9NNA&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+openid&authuser=0&prompt=none
{
  "message": "Invalid origin",
  "code": "INVALID_ORIGIN"
}

What version of Better Auth are you using?

1.1.6

Provide environment information

- OS: Server Environment Bun
- Brower: Chrome

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

trustedOrigins: [env.BETTER_AUTH_URL],
socialProviders: {
    google: {
      clientId: env.GOOGLE_CLIENT_ID,
      clientSecret: env.GOOGLE_CLIENT_SECRET,
    }
},

Additional context

No response

Originally created by @hellokaton on GitHub (Dec 30, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1066 ### Is this suited for github? - [X] Yes, this is suited for github ### To Reproduce I didn't make any changes, I just encountered this issue when upgrading from version `1.1.4` to version `1.1.6` ### Current vs. Expected behavior ``` /api/auth/callback/google?state=3_i8sWggoMcXSobH0Wbck5D81_f0nAph&code=4%2F0AanRRru7XcG2vj4tqW0w1Y5hhOSz2o2E4Q3GOKucPgp7La1OBn0nkq1WTmETen4Fwl9NNA&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+openid&authuser=0&prompt=none ``` ```json { "message": "Invalid origin", "code": "INVALID_ORIGIN" } ``` ### What version of Better Auth are you using? 1.1.6 ### Provide environment information ```bash - OS: Server Environment Bun - Brower: Chrome ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript trustedOrigins: [env.BETTER_AUTH_URL], socialProviders: { google: { clientId: env.GOOGLE_CLIENT_ID, clientSecret: env.GOOGLE_CLIENT_SECRET, } }, ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-13 03:41:50 -05:00
Author
Owner

@productdevbook commented on GitHub (Jan 4, 2025):

OIDC Provider with the same error on my installation.

<!-- gh-comment-id:2571262388 --> @productdevbook commented on GitHub (Jan 4, 2025): OIDC Provider with the same error on my installation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8578