main
|
Last change
on this file since ae924a2 was c80e78b, checked in by roboburr <roboburr@…>, 3 months ago |
|
auth: replace username/password with Google login
Listeners (and the owner) now log in via Google instead of a local
username/password account. This lowers the barrier to commenting and
removes the home-built password/registration system.
- src/config/google.js: raw OAuth2 helpers (authorize/token/userinfo) via
the built-in fetch, config-driven. Boot keeps working without credentials.
- src/routes/auth.js: /auth/google + /auth/google/callback (find-or-create
user on email, ADMIN_EMAIL -> god, set session). login/register/reset POST
handlers removed; /login now shows the Google button.
- database.js: idempotent column users.google_sub.
- account.js + account.ejs: change-password removed.
- auth-login.ejs / welcome.ejs: Google button instead of password form.
- shared-styles.ejs: .btn-google styling.
- .env.example: GOOGLE_CLIENT_ID/SECRET/REDIRECT_URI + ADMIN_EMAIL.
Existing users are matched on email (owner retains their site).
DO NOT deploy to roboburr until the Google credentials are in .env, otherwise
the owner locks themselves out.
Co-Authored-By: Claude <noreply@…>
|
-
Property mode
set to
100644
|
|
File size:
1.0 KB
|
| Line | |
|---|
| 1 | NODE_ENV=development
|
|---|
| 2 | PORT=3000
|
|---|
| 3 | SESSION_SECRET=change-me-to-a-strong-random-string-min-32-chars
|
|---|
| 4 | DATABASE_PATH=./storage/database.sqlite
|
|---|
| 5 | MEDIA_PATH=./storage/media
|
|---|
| 6 |
|
|---|
| 7 | # ── Google login (OAuth2) ──────────────────────────────────────────
|
|---|
| 8 | # Inloggen gaat volledig via Google. Maak een OAuth-client aan in de
|
|---|
| 9 | # Google Cloud Console (APIs & Services -> Credentials -> OAuth client ID,
|
|---|
| 10 | # type "Web application") en vul hieronder in. Zonder deze waarden boot de
|
|---|
| 11 | # app gewoon, maar toont de loginpagina "nog niet geconfigureerd".
|
|---|
| 12 | #
|
|---|
| 13 | # GOOGLE_REDIRECT_URI moet EXACT overeenkomen met een "Authorized redirect
|
|---|
| 14 | # URI" in de Google-client, en is per site het eigen domein + /auth/google/callback.
|
|---|
| 15 | GOOGLE_CLIENT_ID=
|
|---|
| 16 | GOOGLE_CLIENT_SECRET=
|
|---|
| 17 | GOOGLE_REDIRECT_URI=https://example.com/auth/google/callback
|
|---|
| 18 |
|
|---|
| 19 | # Het Google-e-mailadres dat owner/admin (god) is op deze instance.
|
|---|
| 20 | # De eerste gebruiker die inlogt wordt sowieso god als de DB nog leeg is.
|
|---|
| 21 | ADMIN_EMAIL=
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.