Docs
Authentication
Authentication
Configure authentication providers for GudCal.
GudCal supports three authentication methods out of the box: Google OAuth, email/password, and passwordless magic links.
Environment Variables
Add these to your .env.local file:
# Required — session encryption key
AUTH_SECRET="your-random-secret-here"
# Google OAuth (optional but recommended)
GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="your-client-secret"Generate AUTH_SECRET with:
npx auth secret
# or
openssl rand -base64 33Google OAuth Setup
Create a Google Cloud project
Go to the Google Cloud Console and create a new project (or select an existing one).
Configure the OAuth consent screen
- Navigate to APIs & Services → OAuth consent screen
- Choose External user type
- Fill in the app name, support email, and developer contact
- Add the scopes:
email,profile,openid
Create OAuth credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Application type: Web application
- Add authorized redirect URIs:
- Local:
http://localhost:3000/api/auth/callback/google - Production:
https://yourdomain.com/api/auth/callback/google
- Local:
- Copy the Client ID and Client Secret to your
.env.local
Email/Password
Email and password authentication works out of the box with no additional configuration. Passwords are hashed with bcryptjs (12 rounds).
Magic Links
Magic link (passwordless) login requires a configured email provider. See the Email setup guide to configure Resend.
Users who sign up via Google OAuth cannot use password login unless they set a password through the forgot-password flow.
