Skip to content

fix(service): Rallly login fails with invalid origin error#9536

Open
SeriousM wants to merge 1 commit intocoollabsio:nextfrom
SeriousM:patch-1
Open

fix(service): Rallly login fails with invalid origin error#9536
SeriousM wants to merge 1 commit intocoollabsio:nextfrom
SeriousM:patch-1

Conversation

@SeriousM
Copy link
Copy Markdown
Contributor

Changes

  • Setting the BETTER_AUTH_TRUSTED_ORIGINS allows the validation to pass.

  • Using BETTER_AUTH_URL is no option as it's set by NEXT_PUBLIC_BASE_URL which in turn is set to http://localhost:3000 by the build docker image.

Issues

  • Every registration and login attempt will fail with "invalid origin" error message and the log message "ERROR [Better Auth]: Invalid origin: public-url.com"

Category

  • Bug fix
  • Improvement
  • New feature
  • Adding new one click service
  • Fixing or updating existing one click service

Preview

AI Assistance

  • AI was NOT used to create this PR
  • AI was used (please describe below)

If AI was used:

  • Tools used:

Claude code to find the issue, tested by hand.

  • How extensively:

just to find the bug in the Rallly/Better Auth combination.

Testing

First I encountered the issue, then I tried to find the right env variable which I thought would be "BETTER_AUTH_URL" but that didn't worked out. The next one was "NEXT_PUBLIC_BASE_URL", suggested by other users on the internet having issues with Better Auth - still no luck.
I gave claude my env-setup and the repository and it found that BETTER_AUTH_URL is not the solution because NEXT_PUBLIC_BASE_URL is baked into the image as http://localhost:3000. It also found out that BETTER_AUTH_TRUSTED_ORIGINS will work as it's the dedicated way to tell Better Auth the trusted origins.

Contributor Agreement

Important

  • I have read and understood the contributor guidelines. If I have failed to follow any guideline, I understand that this PR may be closed without review.
  • I have searched existing issues and pull requests (including closed ones) to ensure this isn't a duplicate.
  • I have tested all the changes thoroughly with a local development instance of Coolify and I am confident that they will work as expected when a maintainer tests them.

Every registration and login attempt will fail with "invalid origin" error message and the log message "ERROR [Better Auth]: Invalid origin: public-url.com"

Setting the BETTER_AUTH_TRUSTED_ORIGINS allows the validation to pass.

Using BETTER_AUTH_URL is no option as it's set by NEXT_PUBLIC_BASE_URL which in turn is set to http://localhost:3000 by the build docker image.
@ShadowArcanist ShadowArcanist changed the title Rallly: Fix "invalid origin" with BETTER_AUTH_TRUSTED_ORIGINS fix(service): Rallly login fails with invalid origin error Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant