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
+20 -10
+20 -10
View File
@@ -67,16 +67,26 @@ export function render(host, { state }) {
}), }),
), ),
config.setupAvailable && // Always reachable: when Discord sign-in is broken or not set up yet,
h( // this is the only way back into the configuration, and hiding it left
'div', // no visible way out.
{ class: 'stack' }, h(
h('hr', { style: { border: 'none', borderTop: '1px solid var(--border)', width: '100%' } }), 'details',
field('Jeton d’amorçage', tokenInput, { { class: 'stack', style: { textAlign: 'left', width: '100%' }, open: !config.oauthConfigured },
help: 'Affiché par `npm run setup`, ou défini dans `WEB_SETUP_TOKEN`. Il ne donne accès qu’à la configuration.', h('summary', { text: 'Se connecter avec un jeton de configuration' }),
}), field('Jeton d’amorçage', tokenInput, {
button('Ouvrir l’assistant de configuration', submitSetupToken, { tone: 'ghost' }), 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,
}),
),
), ),
), ),
); );