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:
1 file changed
+20
-10
@@ -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,
|
||||
}),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user