Skip to content

(fix): initialize googleClient OAuth2Client instance before use#109

Open
Siddh2024 wants to merge 1 commit into
mayo-byte07:mainfrom
Siddh2024:fix/google-oauth-init
Open

(fix): initialize googleClient OAuth2Client instance before use#109
Siddh2024 wants to merge 1 commit into
mayo-byte07:mainfrom
Siddh2024:fix/google-oauth-init

Conversation

@Siddh2024
Copy link
Copy Markdown

Description

googleClient was imported but never instantiated (new OAuth2Client(...)), so any Google OAuth request would throw a ReferenceError at runtime. This fix initializes the client when GOOGLE_CLIENT_ID is configured and adds a guard to return a clear error when it's not configured.

Changes

  • server.js: Initialize googleClient OAuth2Client instance after JWT_SECRET check
  • server.js: Add guard to return 503 if Google OAuth is not configured

Details

The existing frontend flow (Google GSI SDK in login.html/signup.html, token exchange in auth.js) was already correctly implemented — only the backend initialization was missing.

closes #70 , @mayo-byte07 , please approve this PR , thnx.

- googleClient was imported but never instantiated, causing ReferenceError
- Added conditional initialization with GOOGLE_CLIENT_ID env var
- Added guard to return 503 if Google auth is not configured
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 27, 2026

@Siddh2024 is attempting to deploy a commit to the Mayo's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

[FEATURE] Addition of Google Auth on account creation or login.

1 participant