docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a user authentication service that allows users to sign in using their Google accounts. The service should provide authentication routes and handle the complete OAuth flow.
Your implementation should:
Set up a Google OAuth 2.0 authentication strategy with the following configuration:
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET/auth/google/callbackprofile and email scopesCreate two authentication routes:
/auth/google - Initiates the Google authentication flow/auth/google/callback - Handles the callback from Google after authenticationAfter successful authentication, redirect users to /dashboard
After failed authentication, redirect users to /login
Store basic user information (Google ID, display name, and email) in memory during the authentication callback
/auth/google, the authentication flow is initiated with Google @test/dashboard @test/login @test/**
* Configure Google OAuth 2.0 authentication strategy and routes
* @param {Object} app - Express application instance
* @param {Object} passport - Passport instance
* @returns {void}
*/
function setupGoogleAuth(app, passport);Authentication middleware for Node.js
Provides Google OAuth authentication strategies for Passport.js
Web framework for handling HTTP requests and routes