Auth Setup Guide

AI Knowledge Hub uses device-local auth (localStorage). This guide covers Google OAuth setup and session behavior.

Google Sign-In Setup

To enable "Sign in with Google" on the login and register pages:

  1. Go to Google Cloud Console → Credentials
  2. Create or select a project, then Create Credentials → OAuth client ID
  3. Configure the OAuth consent screen if prompted
  4. Choose Web application, add your origins (e.g. https://your-domain.com)
  5. Copy the Client ID (format: 123456789-abc.apps.googleusercontent.com)
  6. Log in to Admin → Settings → paste the Client ID → Save

The Client ID is stored in localStorage on this device. The "Sign in with Google" button will appear on login and register pages.

Session & Login Behavior

SettingValueNotes
Session length7 daysSessions expire 7 days after login
Expiry noticeUnder 2 daysHeader shows "Session expires in X hours/days" when logged in
StorageDevice onlyAccounts and data stay in this browser

All sessions last 7 days by design. Use Profiles to export a backup.

Local / Demo Mode & Production Plan

Current setup: Auth uses device-local storage (localStorage). No backend — suitable for personal use and demos. Data is not synced across devices. For production with multi-device sync and persistent accounts, consider migrating to Firebase or another backend.

Firebase migration: Replace auth.js with Firebase Auth + Firestore. Store stack, ratings, directUse, wantToTry per user in Firestore. Add feature-flag to switch between local and Firebase.

Full migration details are in docs/AUTH.md in the project source.

← Back to Log in