Changeset 247988e in Klonkt for src/views/pages/account.ejs


Ignore:
Timestamp:
06/19/2026 09:55:26 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
f33b24a
Parents:
535f955
Message:

feat(auth): admin can link Google and use it to log in

  • Account → "Sign in with Google": link/unlink your Google account (/auth/google/link, requireAuth → stores google_sub on own account).
  • Google callback: link mode alongside login mode. An admin may log in with Google ONLY if their google_sub is linked and matches (otherwise "Google = never admin" rule holds). Unlinking requires a password (no lockout).
  • Admin notice on the login page explains the link route.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

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

    r535f955 r247988e  
    132132    </form>
    133133  </section>
     134
     135  <% if (typeof googleAvailable !== 'undefined' && googleAvailable) { %>
     136  <section class="ax-card">
     137    <div class="ax-card-title">Inloggen met Google</div>
     138    <% if (typeof googleLinked !== 'undefined' && googleLinked) { %>
     139      <p class="ax-tagline" style="margin:0 0 1rem">✓ Je Google-account is gekoppeld — je kunt ook met Google inloggen.</p>
     140      <form action="/account/google/unlink" method="post">
     141        <button type="submit" class="ax-btn">Google ontkoppelen</button>
     142      </form>
     143    <% } else { %>
     144      <p class="ax-tagline" style="margin:0 0 1rem">Koppel je Google-account zodat je voortaan ook met één klik via Google kunt inloggen (naast je wachtwoord).</p>
     145      <a href="/auth/google/link" class="ax-btn ax-btn-primary" data-full-load>Koppel Google-account</a>
     146    <% } %>
     147  </section>
     148  <% } %>
    134149  <% } else { %>
    135150  <section class="ax-card">
Note: See TracChangeset for help on using the changeset viewer.