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

Create GitHub OAuth keys for our Railway deployment #110

Open
aryanprince opened this issue Nov 25, 2023 · 0 comments
Open

Create GitHub OAuth keys for our Railway deployment #110

aryanprince opened this issue Nov 25, 2023 · 0 comments
Assignees
Labels
🛂 auth Authentication stuff using NextAuth

Comments

@aryanprince
Copy link
Member

aryanprince commented Nov 25, 2023

Summary

We need different pairs of OAuth keys for deploying our application on each place. Meaning we have 1 pair of keys for our Vercel deployment, one pair of keys for Railway deployment, and also one pair of keys for local development.

Wait what's the issue then?

Try logging in from our Railway deployment, you'll see that it 'redirects' us to our Vercel deployment cus we are currently using the Vercel deployment GitHub OAuth keys in Railway right now. That's not good.

Task

  1. Head to GitHub's settings and create an OAuth application
    • GitHub will ask you for a few details like Homepage URL and Authorization callback URL
    • Homepage URL is the domain (https://...) of our Railway deployment, you can find it on Railway.
    • Authorization callback URL is always domain + /api/auth/callback/github (w/o plus, one word)
  2. Copy the new client and secret ID values
  3. Head to Railway, and to our Dashboard (Next.js) deployment. And replace the NEXTAUTH_GITHUB_CLIENT_ID and NEXTAUTH_GITHUB_SECRET_ID with the new OAuth tokens you generated
  4. Redeploy our dashboard and see if you are able to log in now properly now (check if domain after logging in is indeed our Railway deployment URL)
@aryanprince aryanprince added the 🛂 auth Authentication stuff using NextAuth label Nov 25, 2023
@aryanprince aryanprince added this to the Final Presentation milestone Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛂 auth Authentication stuff using NextAuth
Projects
None yet
Development

No branches or pull requests

2 participants