Invalid currentURL in production mode when login with provider #350

Closed
opened 2026-03-13 07:42:47 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @Moumouuu on GitHub (Dec 6, 2024).

Describe the bug
Only in production i have this error when I try to sign in with a provider like google :
message : Invalid currentURL
code : INVALID_CURRENTURL

The URL of the request : (POST)
https://xx.yyy.fr/api/auth/sign-in/social?currentURL=https://xx.yyy.fr/sign-in

Screenshots

Request :
Capture d’écran 2024-12-06 à 18 26 24
Response :

Capture d’écran 2024-12-06 à 18 26 05
Originally created by @Moumouuu on GitHub (Dec 6, 2024). **Describe the bug** Only in production i have this error when I try to sign in with a provider like google : message : Invalid currentURL code : INVALID_CURRENTURL The URL of the request : (POST) https://xx.yyy.fr/api/auth/sign-in/social?currentURL=https://xx.yyy.fr/sign-in **Screenshots** Request : <img width="159" alt="Capture d’écran 2024-12-06 à 18 26 24" src="https://github.com/user-attachments/assets/0849300e-3dbe-4e5e-8856-9ee49d548fe5"> Response : <img width="217" alt="Capture d’écran 2024-12-06 à 18 26 05" src="https://github.com/user-attachments/assets/fedbe30c-938b-43ad-9841-c6acfc793088">
Author
Owner

@Bekacru commented on GitHub (Dec 6, 2024):

make sure to include your frontend url in trustedOrigins list

@Bekacru commented on GitHub (Dec 6, 2024): make sure to include your frontend url in `trustedOrigins` list
Author
Owner

@Moumouuu commented on GitHub (Dec 6, 2024):

make sure to include your frontend url in trustedOrigins list

Thanks, it works! But where is this information in the documentation?
I’m using Next.js, and my app combines both the backend and the frontend. Am I missing something?

By the way, thank you so much for what you’re doing I love it!

@Moumouuu commented on GitHub (Dec 6, 2024): > make sure to include your frontend url in `trustedOrigins` list Thanks, it works! But where is this information in the documentation? I’m using Next.js, and my app combines both the backend and the frontend. Am I missing something? By the way, thank you so much for what you’re doing I love it!
Author
Owner

@Bekacru commented on GitHub (Dec 6, 2024):

Hey thanks! If your just using next, it should work. Maybe you have set BETTER_AUTH_URL to a wrong value in prod.

@Bekacru commented on GitHub (Dec 6, 2024): Hey thanks! If your just using next, it should work. Maybe you have set `BETTER_AUTH_URL` to a wrong value in prod.
Author
Owner

@Moumouuu commented on GitHub (Dec 6, 2024):

The value in prod is correct, maybe I make a mistake somewhere.. In all cases, thanks for you help and your reactivity :)

@Moumouuu commented on GitHub (Dec 6, 2024): The value in prod is correct, maybe I make a mistake somewhere.. In all cases, thanks for you help and your reactivity :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#350