Changeset 075185a in Klonkt for src/routes/admin-settings.js


Ignore:
Timestamp:
06/24/2026 02:16:57 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
2e9773f
Parents:
5b47619
Message:

refactor(auth): remove Google login (listeners now interact via the fediverse)

Removes config/google.js, the /auth/google* routes, the admin Google config page
+ links, the account link/unlink, and the public Google login button. /login and
/auth/admin both show the admin password form. SEO/Search-Console Google is
untouched. (Native comments removed next.)

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/admin-settings.js

    r5b47619 r075185a  
    2525import { mailerStatus, sendMail } from '../config/mailer.js';
    2626import { entitlementStatus, premiumUnlocked } from '../services/PatreonService.js';
    27 import { googleConfigured, redirectUri, currentClientId, clientSecretSet } from '../config/google.js';
    2827import { toWebp } from '../services/ImageWebpService.js';
    2928
     
    8180    defaultLang: getSetting('default_lang') || '',
    8281    premium: entitlementStatus(),
    83     google: {
    84       configured: googleConfigured(),
    85       redirectUri: redirectUri(),
    86       clientId: currentClientId(),
    87       secretSet: clientSecretSet(),
    88     },
    8982    smtp: mailerStatus(),
    9083    footerNewsletter: getSetting('footer_newsletter') === '1',
     
    155148});
    156149
    157 // Google login on its own admin page (separate from the general settings).
    158 router.get('/google', requireGod, (req, res) => {
    159   renderPage(req, res, 'pages/admin-google', {
    160     pageTitle: 'Google-login',
    161     bodyClass: 'on-admin',
    162     google: {
    163       configured: googleConfigured(),
    164       redirectUri: redirectUri(),
    165       clientId: currentClientId(),
    166       secretSet: clientSecretSet(),
    167     },
    168     success: req.query.success || null,
    169     error: req.query.error || null,
    170   });
    171 });
    172 
    173 // Configure Google login (listeners) — Client ID + Secret in app_settings.
    174 // The redirect URI is derived from PUBLIC_BASE_URL (see config/google.js).
    175 router.post('/google', requireGod, (req, res) => {
    176   if (req.body.clear === '1') {
    177     setSetting('google_client_id', '');
    178     setSetting('google_client_secret', '');
    179     return res.redirect('/admin/settings?success=' + encodeURIComponent('Google-login losgekoppeld'));
    180   }
    181   setSetting('google_client_id', (req.body.google_client_id || '').toString().trim());
    182   // Only overwrite the secret if a new value was entered (empty = leave as-is).
    183   const secret = (req.body.google_client_secret || '').toString().trim();
    184   if (secret) setSetting('google_client_secret', secret);
    185   res.redirect('/admin/settings?success=' + encodeURIComponent('Google-login opgeslagen'));
    186 });
    187 
    188150// ── SMTP / e-mail-instellingen ────────────────────────────────────
    189151router.post('/smtp', requireGod, (req, res) => {
Note: See TracChangeset for help on using the changeset viewer.