diff --git a/src/web/public/views/login.js b/src/web/public/views/login.js index 60711fd..bf7f899 100644 --- a/src/web/public/views/login.js +++ b/src/web/public/views/login.js @@ -67,16 +67,26 @@ export function render(host, { state }) { }), ), - config.setupAvailable && - h( - 'div', - { class: 'stack' }, - h('hr', { style: { border: 'none', borderTop: '1px solid var(--border)', width: '100%' } }), - field('Jeton d’amorçage', tokenInput, { - help: 'Affiché par `npm run setup`, ou défini dans `WEB_SETUP_TOKEN`. Il ne donne accès qu’à la configuration.', - }), - button('Ouvrir l’assistant de configuration', submitSetupToken, { tone: 'ghost' }), - ), + // Always reachable: when Discord sign-in is broken or not set up yet, + // this is the only way back into the configuration, and hiding it left + // no visible way out. + h( + 'details', + { class: 'stack', style: { textAlign: 'left', width: '100%' }, open: !config.oauthConfigured }, + h('summary', { text: 'Se connecter avec un jeton de configuration' }), + field('Jeton d’amorçage', tokenInput, { + help: 'Affiché par `npm run setup`, ou défini dans `WEB_SETUP_TOKEN`. Il ne donne accès qu’à la configuration, jamais au reste du site.', + }), + !config.setupAvailable && + notice( + 'Aucun jeton n’est configuré pour l’instant. Renseigne `WEB_SETUP_TOKEN` dans le .env puis redémarre le bot, ou lance `npm run setup` pour en obtenir un temporaire.', + 'info', + ), + button('Ouvrir l’assistant de configuration', submitSetupToken, { + tone: 'ghost', + disabled: !config.setupAvailable, + }), + ), ), ), );