Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http://localhost:3000 redirect after deploy at fly.io (after Clerk auth) #73

Closed
nttylock opened this issue Jul 19, 2023 · 3 comments
Closed
Assignees

Comments

@nttylock
Copy link

Hello everyone,

First of all, I apologize in advance if my questions seem basic - I'm still learning and I'm very much in the beginner stages.

I've been following the README instructions of my project meticulously.
Everything works perfectly fine local, and I have successfully deployed the application to Fly.io.

However, things take a turn for the worse when I attempt to log in. After entering my credentials (Clerk), I get redirected to this URL:

http://localhost:3000/#__clerk_db_jwt[eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXYiOiJkdmJfMlNsZUZHOGlqNlZGb3lleWF0Rk5GMThVNUJKIn0.x8TQP_RZ1iWQDB52Rj4I7RBYqRI-nZcpYizDftav_V_zO4P6qW9zSMP_KEQPDSxPD6hXCpKGuDwj33LCOq2Z42Uc-OEKoLsrbWBHDp9DXPCJFPo_tCQ1GUmC4bkBWGIiEXkG6mYVhgjjXIatLQeL9qTqn-YPFrkHqD8ocZu4mam2YZ5U0alACrlsbVJXJ0-QJFmzjQRcIgkZ66eOIhPWNSly1MFc2tXHNlRUB-ci6iwq74MmhTby-xOF50wEiiyVDY7C59HIupcpU4kI6ZSjFPdY2PMQgyzKeh03SxbPJgXe8O--cTA4zCRNXKHT-oQEfwk8VchQgeXcaMVWQj5PQA]

Unfortunately, it leads to nowhere and I'm at a loss as to what went wrong. I understand that there is something amiss with my setup, but being a novice, I'm unable to pinpoint the exact problem.

I would greatly appreciate it if anyone could offer some guidance or insights on this.

Thank you so much in advance for your time and patience!

@ykhli
Copy link
Contributor

ykhli commented Jul 19, 2023

Ah! I should really add this to FAQ

You can fix this by adding CLERK_USE_X_FWD_HEADERS=true to .env.local (or .env.prod) and deploy again. Please let me know if it works!

@ykhli ykhli self-assigned this Jul 19, 2023
@nttylock
Copy link
Author

Thanks you very much, resolved! Very appreciated.

@gvzdv
Copy link

gvzdv commented Jul 19, 2023

Hi @ykhli! Thank you for the fix. It helped me to get rid of the same problem (redirection to localhost), but now I get port 80 in my URL. When I manually delete ":80" from the URL, redirection works. Can you please help me try to find a solution to this problem?

Fly.io was down for some time yesterday, so I launched the project using Google Cloud Run.
The URL looks like this: https://ai-bro-5oxslodcwq-uc.a.run.app:80/sign-in?redirect_url=https%3A%2F%2Fai-bro-5oxslodcwq-uc.a.run.app%3A80%2F#__clerk_db_jwt[eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXYiOiJkdmJfMlNtQXNodkYyN0dkdkF4UnRyekw2SnZJOTB6In0.Xq2T0PdayYJqOOFvOaapXNC7neWD-_1pbvNTniRWkG9QaUGL3x8soWOpvfQyRFXUOJpOXMbzViEFWQIbxgiWaRJH3pt9QU9K96fVFVh8ctT8czcH6b5zivwhAUwRLUrhi4DUlanFa7kvEiHskMX7lYTrag2hqLEXriSTx-OxEy606HEPPv3C5RYCZWVFyIOT_h5sreSfBX7oZH77AWq1LggKP-NcZzXNVXLx72LH_Zg1PLv8lSwDIz1sKxUPFxhThWX_EZpCkXI0zTbjIogFtqj8Ae60jFsdkeqqlOYwbmGZ802S_8Jw9VTnAh-ZwE_IBuRrVaBSb09i8kBcDvmvOQ]

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

No branches or pull requests

3 participants