Github auth working locally but not in Vercel. Using custom login page #12826
Replies: 1 comment
-
Coming back to it some days later, it all seems to be working now 🤷♂️ . Will close the issue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Github auth works fine locally but when I deploy my Next.js app to Vercel and click the login button on my custom login page, nothing happens. There's nothing in error or console logs and when I view network logs I just see a cancelled request POST'ing to my custom login page:
I've added the AUTH_SECRET, AUTH_GITHUB_ID, and AUTH_GITHUB_SECRET production environment variables.
Bizzarely, it did work one time - I was redirected to Github and then back to app. But when I logged out and tried again, I'm back to the situation above.
Here's my code in
src/app/custom-login-page/page.tsx
:And
signin
imported fromimport { signIn } from "@/auth";
(see below)Anyone got any ideas? I think I've followed all the guides, so really surprised this is proving so difficult.
UPDATE: I tried removing the
pages
entry from my authConfig (so it uses the built-in login page), and with that one change everything works perfectly - so the environment variables seem fine. Is using a custom login page just broken / flaky in the beta?My auth config:
Auth.ts:
Middleware:
Versions:
Beta Was this translation helpful? Give feedback.
All reactions