Changeset f4b7b6a in Klonkt for src/views/pages


Ignore:
Timestamp:
06/19/2026 09:31:54 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
1e2e9e7
Parents:
1080d14
Message:

feat(auth): public login = Google only; admin login hidden at /auth/admin

  • /auth/login shows visitors only "Sign in with Google" (listeners/fans).
  • Admin login (username/password) moved to hidden /auth/admin, linked from nowhere. POST errors + password-reset success redirect to /auth/admin.
  • gerr=admin notice (Google with admin address) now links to /auth/admin.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/auth-login.ejs

    r1080d14 rf4b7b6a  
     1<%
     2  // adminLogin = de verborgen beheerders-loginpagina (/auth/admin): toont het
     3  // gebruikersnaam/wachtwoord-formulier. De publieke /auth/login toont voor
     4  // bezoekers ALLEEN Google-login (luisteraars/fans). Zo staat de admin-login
     5  // niet zichtbaar op de plek waar bezoekers heen gestuurd worden.
     6  var _admin = (typeof adminLogin !== 'undefined' && adminLogin);
     7%>
    18<div class="container auth-page">
    2   <h1>Inloggen</h1>
     9  <h1><%= _admin ? 'Beheerder inloggen' : 'Inloggen' %></h1>
    310  <% if (typeof success !== 'undefined' && success) { %><div class="alert alert-success"><%= success %></div><% } %>
    411  <%
     
    613      admin: { icon: '🔐', title: 'Dit is een beheerders-account',
    714        body: 'Je logde in met Google, maar dit e-mailadres hoort bij de beheerder van deze site. Inloggen met Google is alleen voor luisteraars/fans — beheerders gebruiken altijd hun wachtwoord (zo kan een Google-login nooit per ongeluk beheerrechten geven).',
    8         list: ['<strong>Ben je de beheerder?</strong> Log hieronder in met je <strong>gebruikersnaam + wachtwoord</strong>.', '<strong>Wil je als fan inloggen?</strong> Gebruik een <strong>ander Google-account</strong> (niet je beheerdersadres).'] },
     15        list: ['<strong>Ben je de beheerder?</strong> <a href="/auth/admin">Log in met je gebruikersnaam + wachtwoord</a>.', '<strong>Wil je als fan inloggen?</strong> Gebruik een <strong>ander Google-account</strong> (niet je beheerdersadres).'] },
    916      session: { icon: '⏱️', title: 'Login afgebroken', body: 'De Google-login is afgebroken of de sessie was verlopen. Probeer het gewoon opnieuw.' },
    10       email: { icon: '✉️', title: 'Geen geverifieerd e-mailadres', body: 'Je Google-account heeft geen geverifieerd e-mailadres. Verifieer je adres bij Google, of log in met je wachtwoord.' },
     17      email: { icon: '✉️', title: 'Geen geverifieerd e-mailadres', body: 'Je Google-account heeft geen geverifieerd e-mailadres. Verifieer je adres bij Google.' },
    1118      linked: { icon: '🔗', title: 'Adres al gekoppeld', body: 'Dit e-mailadres is al aan een ander Google-account gekoppeld. Gebruik dat account, of neem contact op met de beheerder.' },
    12       unavailable: { icon: '🚫', title: 'Google-login niet beschikbaar', body: 'Inloggen met Google is op deze site (nog) niet ingesteld. Log in met je gebruikersnaam en wachtwoord.' },
     19      unavailable: { icon: '🚫', title: 'Google-login niet beschikbaar', body: 'Inloggen met Google is op deze site (nog) niet ingesteld.' },
    1320      failed: { icon: '⚠️', title: 'Google-login mislukt', body: 'Er ging iets mis bij het inloggen met Google. Probeer het opnieuw.' },
    1421    };
     
    2431  <% } else if (error) { %><div class="alert alert-error"><%= error %></div><% } %>
    2532
    26   <form method="post" action="/auth/login" class="auth-form">
    27     <% if (typeof next !== 'undefined' && next) { %>
    28       <input type="hidden" name="next" value="<%= next %>">
    29     <% } %>
    30     <label>
    31       <span>Gebruikersnaam of e-mail</span>
    32       <input type="text" name="username" value="<%= username %>" required autofocus autocomplete="username">
    33     </label>
    34     <label>
    35       <span>Wachtwoord</span>
    36       <input type="password" name="password" required autocomplete="current-password">
    37     </label>
    38     <button type="submit" class="btn btn-primary">Inloggen</button>
    39     <p class="auth-link auth-link-muted"><a href="/auth/reset-request">Wachtwoord vergeten?</a></p>
    40   </form>
    41 
    42   <% if (googleReady) { %>
    43     <div class="auth-divider"><span>of als luisteraar</span></div>
     33  <% if (_admin) { %>
     34    <%# Verborgen beheerders-login (wachtwoord). %>
     35    <form method="post" action="/auth/login" class="auth-form">
     36      <% if (typeof next !== 'undefined' && next) { %>
     37        <input type="hidden" name="next" value="<%= next %>">
     38      <% } %>
     39      <label>
     40        <span>Gebruikersnaam of e-mail</span>
     41        <input type="text" name="username" value="<%= username %>" required autofocus autocomplete="username">
     42      </label>
     43      <label>
     44        <span>Wachtwoord</span>
     45        <input type="password" name="password" required autocomplete="current-password">
     46      </label>
     47      <button type="submit" class="btn btn-primary">Inloggen</button>
     48      <p class="auth-link auth-link-muted"><a href="/auth/reset-request">Wachtwoord vergeten?</a></p>
     49    </form>
     50  <% } else if (googleReady) { %>
     51    <%# Publieke login: alleen Google, voor luisteraars/fans. %>
     52    <p class="auth-sub">Log in om te reageren en je favorieten te bewaren.</p>
    4453    <a class="btn btn-google" href="/auth/google<%= (typeof next !== 'undefined' && next) ? '?next=' + encodeURIComponent(next) : '' %>">
    4554      <svg class="g-icon" width="18" height="18" viewBox="0 0 18 18" aria-hidden="true">
     
    5160      <span>Inloggen met Google</span>
    5261    </a>
     62  <% } else { %>
     63    <div class="alert">Inloggen met Google is op deze site nog niet ingesteld.</div>
    5364  <% } %>
    5465</div>
     
    6172  .auth-notice-list { margin: 0; padding-left: 18px; line-height: 1.6; }
    6273  .auth-notice-list li { margin: 4px 0; }
     74  .auth-sub { color: var(--ink-muted); margin: 0 0 1rem; }
    6375</style>
Note: See TracChangeset for help on using the changeset viewer.