This service provides Google OAuth authentication for your application with a profile collection form.
Click the button below to test the authentication flow:
Login with GoogleRedirects the user to Google for authentication.
Handles the OAuth callback from Google. Sets a session cookie and redirects to the profile form if needed.
Displays a form to collect additional user information (name, institution, position).
Accepts form submissions and updates the user profile.
Returns the current user's profile information (requires authentication).
Logs the user out by clearing their session cookie.
Displays the Terms and Conditions page.
Displays the Privacy Policy page.
To integrate with your application:
/login to begin authentication./chat with a session cookie.The service sets a cookie named __hl_session containing a UUID that identifies the user session.
// Check for auth cookie
const uuid = getCookie(request, '__hl_session');
if (!uuid) {
return Response.redirect('/login', 302);
}
// Verify user exists in KV
const userJson = await env.USERS.get(`user:${uuid}`);
if (!userJson) {
return Response.redirect('/login', 302);
}
// User is authenticated
const user = JSON.parse(userJson);
// Continue with your application logic