main
|
Last change
on this file since 32cc601 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:
986 bytes
|
| Rev | Line | |
|---|
| [7bc636b] | 1 | <div class="container welcome-page">
|
|---|
| 2 | <h1>Welcome to PrutCMS</h1>
|
|---|
| 3 | <p class="welcome-tagline">A self-hosted publishing platform.</p>
|
|---|
| 4 |
|
|---|
| 5 | <% if (!user) { %>
|
|---|
| 6 | <div class="welcome-actions">
|
|---|
| [c80e78b] | 7 | <a href="/auth/login" class="btn btn-primary">Inloggen met Google</a>
|
|---|
| [7bc636b] | 8 | </div>
|
|---|
| [c80e78b] | 9 | <p class="welcome-note">De eerste gebruiker die inlogt wordt <strong>god</strong> en krijgt automatisch een eigen site.</p>
|
|---|
| [7bc636b] | 10 | <% } else { %>
|
|---|
| 11 | <p>Hi <%= user.username %>! No site is configured yet.</p>
|
|---|
| 12 | <% } %>
|
|---|
| 13 | </div>
|
|---|
| 14 | <style>
|
|---|
| 15 | .welcome-page { max-width: 600px; margin: 4rem auto; padding: 0 1rem; text-align: center; }
|
|---|
| 16 | .welcome-page h1 { font-family: var(--font-display, serif); font-size: 2.5rem; margin: 0 0 0.5rem; }
|
|---|
| 17 | .welcome-tagline { color: var(--ink-muted); margin-bottom: 2rem; font-size: 1.1rem; }
|
|---|
| 18 | .welcome-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin: 2rem 0; }
|
|---|
| 19 | .welcome-note { color: var(--ink-muted); font-size: 0.9rem; margin-top: 2rem; }
|
|---|
| 20 | </style>
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.