Skip to content

Add "Login with Google" Authentication Option #6

@vikas-saini-7

Description

@vikas-saini-7

Description

Implement a "Login with Google" authentication option in the Code Collab platform using NextAuth.js with the Google provider.

Why is this feature useful?

  • Simplifies the login experience by allowing users to sign in with their Google accounts.
  • Increases trust and reduces friction for new users joining the platform.
  • Widely expected feature in modern web apps.

How could it work?

  • Use the next-auth package, which is already set up in the project.
  • Add Google provider to authOptions in the NextAuth config file.
  • Use "Continue with Google" button which is already been added in UI.
  • Ensure that user session and database entries are created correctly upon first login.

Screenshots or UI idea (if applicable)

![Image](https://github.com/user-attachments/assets/49887494-654d-48e9-9776-ac6881b090f

Use Tailwind + Shadcn.

Additional Information

  • You'll need to create OAuth credentials in the Google Cloud Console.
  • The following environment variables will be required (add to .env.example too):
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions