Skip to content

Conversation

mehdy76
Copy link

@mehdy76 mehdy76 commented Sep 10, 2025

This pr adds Google as a new OAuth2 authentication provider.
The logic is based on the same existing code for the GitHub provider.

@oxdev03
Copy link
Owner

oxdev03 commented Sep 19, 2025

Hey,
thanks for the pull request. I will test it out.

@oxdev03 oxdev03 self-requested a review September 19, 2025 21:36
userinfo: {
async request({ client, tokens }) {
const profile = await client.userinfo(tokens.access_token!);
await connectDB();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessary

Suggested change
await connectDB();

- **Setup Google OAuth**
- https://console.cloud.google.com/apis/credentials -> New OAuth 2.0 client
- Configure the callback url to `http://<domain|ip:port>/api/auth/callback/google`
- Add `NEXT_PUBLIC_GOOGLE_CLIENT_ID` and `GOOGLE_SECRET` to the `.env` file with the values from the OAuth App
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason, why the env is not named GOOGLE_CLIENT_SECRET?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is not formatted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants