Changeset 70679063 in Klonkt for src/views/pages/auth-login.ejs


Ignore:
Timestamp:
06/19/2026 07:57:15 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
b919a67
Parents:
9b3e12c
Message:

fix: download toggle without page reload + clear explanation page on Google admin login

1) Admin→Audio: the "download-for-email" toggle (⬇) was a form POST with redirect →

full page reload on every click (player + scroll reset). Now AJAX via the existing
/admin/audio/api/:id (accepts downloadable), button state updated in-place, no
reload. (Old POST route stays as an unused fallback.)

2) /auth/login did not show the query error (error:null) → message only appeared in

the URL. Now ?error= is rendered, and the "Google address belongs to an admin"
case gets its own clear explanation block (gerr=admin): why it is rejected + the
two paths (admin = password, fan = different Google account).

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

File:
1 edited

Legend:

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

    r9b3e12c r70679063  
    22  <h1>Inloggen</h1>
    33  <% if (typeof success !== 'undefined' && success) { %><div class="alert alert-success"><%= success %></div><% } %>
    4   <% if (error) { %><div class="alert alert-error"><%= error %></div><% } %>
     4  <% if (typeof gerr !== 'undefined' && gerr === 'admin') { %>
     5    <div class="auth-notice">
     6      <div class="auth-notice-icon">🔐</div>
     7      <h2 class="auth-notice-title">Dit is een beheerders-account</h2>
     8      <p>Je logde in met Google, maar dit e-mailadres hoort bij de <strong>beheerder</strong> van deze site.
     9         Inloggen met Google is alleen voor luisteraars/fans — beheerders gebruiken altijd hun wachtwoord
     10         (zo kan een Google-login nooit per ongeluk beheerrechten geven).</p>
     11      <ul class="auth-notice-list">
     12        <li><strong>Ben je de beheerder?</strong> Log hieronder in met je <strong>gebruikersnaam + wachtwoord</strong>.</li>
     13        <li><strong>Wil je als fan inloggen?</strong> Gebruik een <strong>ander Google-account</strong> (niet je beheerdersadres).</li>
     14      </ul>
     15    </div>
     16  <% } else if (error) { %><div class="alert alert-error"><%= error %></div><% } %>
    517
    618  <form method="post" action="/auth/login" class="auth-form">
     
    3345  <% } %>
    3446</div>
     47
     48<style>
     49  .auth-notice { border: 1px solid rgba(128,128,128,.28); border-radius: 14px; padding: 18px 20px; margin-bottom: 18px; background: rgba(128,128,128,.06); }
     50  .auth-notice-icon { font-size: 26px; }
     51  .auth-notice-title { font-size: 17px; margin: 4px 0 8px; }
     52  .auth-notice p { margin: 0 0 10px; line-height: 1.55; opacity: .9; }
     53  .auth-notice-list { margin: 0; padding-left: 18px; line-height: 1.6; }
     54  .auth-notice-list li { margin: 4px 0; }
     55</style>
Note: See TracChangeset for help on using the changeset viewer.