Changeset c80e78b in Klonkt for src/views/pages/account.ejs


Ignore:
Timestamp:
06/14/2026 04:39:57 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
ae924a2
Parents:
89d6536
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/account.ejs

    r89d6536 rc80e78b  
    55    <div>
    66      <h1>Account</h1>
    7       <p class="ax-tagline">Profiel en wachtwoord.</p>
     7      <p class="ax-tagline">Profiel en avatar.</p>
    88    </div>
    99  </header>
     
    6565  </section>
    6666
    67   <%# ── PASSWORD ──────────────────────────────────────────── %>
     67  <%# ── INLOG ─────────────────────────────────────────────── %>
    6868  <section class="ax-card">
    69     <div class="ax-card-title">Wachtwoord wijzigen</div>
    70     <form action="/account/password" method="post" class="ax-form">
    71       <label class="ax-field">
    72         <span>Huidig wachtwoord</span>
    73         <input type="password" name="current" required autocomplete="current-password">
    74       </label>
    75       <div class="ax-row ax-row-2">
    76         <label class="ax-field">
    77           <span>Nieuw wachtwoord <small>(min 8 tekens)</small></span>
    78           <input type="password" name="new_password" required minlength="8" autocomplete="new-password">
    79         </label>
    80         <label class="ax-field">
    81           <span>Bevestig nieuw wachtwoord</span>
    82           <input type="password" name="confirm" required minlength="8" autocomplete="new-password">
    83         </label>
    84       </div>
    85       <div class="ax-form-actions">
    86         <button type="submit" class="ax-btn ax-btn-primary">🔒 Wachtwoord wijzigen</button>
    87       </div>
    88     </form>
     69    <div class="ax-card-title">Inloggen</div>
     70    <p class="ax-tagline" style="margin:0">Je bent ingelogd via Google (<%= account.email %>). Er is geen apart wachtwoord.</p>
    8971  </section>
    9072
Note: See TracChangeset for help on using the changeset viewer.