Changeset 70679063 in Klonkt for src/routes


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/routes/auth.js

    r9b3e12c r70679063  
    5252    pageTitle: 'Inloggen',
    5353    bodyClass: 'on-special on-auth',
    54     error: null,
     54    error: req.query.error || null,
     55    gerr: req.query.gerr || null, // foutcode voor een rijkere uitleg (bv. 'admin')
    5556    success: req.query.success || null,
    5657    username: '',
     
    275276      // beheerder, dan moet diegene met wachtwoord inloggen (geen Google-bypass).
    276277      if (user.role === 'god' || user.role === 'admin') {
    277         return fail('Dit adres hoort bij een beheerder — log in met je wachtwoord.');
     278        // Eigen, duidelijke uitleg-pagina (zie auth-login.ejs) i.p.v. een kale melding.
     279        return res.redirect('/auth/login?gerr=admin');
    278280      }
    279281      // Bestaande luisteraar: koppel google_sub/avatar als die ontbreken; weiger
Note: See TracChangeset for help on using the changeset viewer.