Auth
ShipAny Next uses better-auth with the Drizzle adapter. The auth config lives in src/core/auth/index.ts; all requests are handled by the catch-all route /api/auth/[...all].
All provider credentials below are configured in admin panel → Settings → Auth (stored in the config table); same-named env vars work as fallbacks.
Email / Password
Enabled by default (email_auth_enabled). Optional email verification:
- Turn on
email_verification_enabledand configure Resend (resend_api_key,resend_sender_email) - Verification links expire after 24 hours; resend is rate-limited to once per 60 seconds
- Password reset emails also go through Resend (1-hour expiration)
Without verification enabled, users are signed in automatically after registration.
Google Login
- Create an OAuth client in the Google Cloud Console (type: Web application)
- Add the authorized redirect URI:
https://your-domain.com/api/auth/callback/google- Fill
google_client_id/google_client_secretin admin Settings - Optionally enable Google One Tap (
google_one_tap_enabled)
GitHub Login
- Create an OAuth App in GitHub → Settings → Developer settings
- Set the callback URL:
https://your-domain.com/api/auth/callback/github- Fill
github_client_id/github_client_secretin admin Settings
Sessions
Sessions are stored in the session table as httpOnly cookies, with ipAddress and userAgent captured. The user table carries extra fields: utmSource, ip, and locale.