a16z-infra/companion-app

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

Closed this issue · 3 comments

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 commented

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!

Thanks you very much, resolved! Very appreciated.