fix(web): always offer the bootstrap token on the sign-in page

The field only appeared when a token was already configured, which hid the
one way back into the configuration exactly when Discord sign-in is broken
or not set up yet. It is now always present, and says how to obtain a token
when none is available.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
nocodeandClaude Opus 5 committed 2026-09-23 20:34:16 +02:00
1 parent ff15dfe92f
commit 9c6297e00e
1 file changed
+16 -6
+16 -6
View File
@@ -67,15 +67,25 @@ export function render(host, { state }) {
}), }),
), ),
config.setupAvailable && // 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( h(
'div', 'details',
{ class: 'stack' }, { class: 'stack', style: { textAlign: 'left', width: '100%' }, open: !config.oauthConfigured },
h('hr', { style: { border: 'none', borderTop: '1px solid var(--border)', width: '100%' } }), h('summary', { text: 'Se connecter avec un jeton de configuration' }),
field('Jeton d’amorçage', tokenInput, { 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.', 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,
}), }),
button('Ouvrir l’assistant de configuration', submitSetupToken, { tone: 'ghost' }),
), ),
), ),
), ),