AuthenticationGitHub Login

GitHub Authentication

Follow these steps to set up GitHub Authentication.

Step 1: Create a GitHub OAuth App

  1. Go to GitHub Developer Settings.
  2. Click on “New OAuth App” to create a new application.
  3. Fill in the necessary details:
    • Application name: Choose a name for your app.
    • Homepage URL: Add the homepage URL for your app.
    • Authorization callback URL:
      • http://localhost:3000/api/auth/callback/github for local development.
      • https://your-app.com/api/auth/callback/github for production.
  4. Click “Register Application.”

Step 2: Copy Credentials to .env.local

  1. After registering your OAuth app, you will receive a Client ID and Client Secret.
  2. In your project’s .env.local file, add the following environment variables and paste the values:
    • GITHUB_CLIENT_ID
    • GITHUB_CLIENT_SECRET