Corrections du testeur « connexion, réglages, double authentification »
deploy / deploy (push) Successful in 39s
deploy / deploy (push) Successful in 39s
- Double authentification : le QR code s'affiche (SVG brut du serveur converti en image) ; un code faux à l'activation affiche « Code incorrect ou expiré » au lieu d'une erreur 422 ; la désactivation demande confirmation - Mode découverte : « Écrire un avis » demande un compte avant de taper (le texte n'est plus perdu) ; le bouton retour depuis l'écran de connexion ramène au mode découverte au lieu de quitter le site ; Sauvegarde / Stockage / Zone sensible masqués (l'import annonçait un succès sans rien importer) ; accueil vide avec un texte propre au mode découverte ; mention « reste sur ton téléphone » retirée - Pages légales et 404 : suivent l'apparence choisie dans l'app (clair / sombre) - Actions irréversibles (effacer, supprimer, bloquer, quitter une liste) : bouton rouge - « Oui / Non » traduits dans le signalement de bug ; tutoiement partout - Écran de connexion sur mobile : marge du haut rétablie ; invitation à créer un compte : le focus va au bouton Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
40 files changed
+176
-45
No files matched your search
+3
-3
@@ -1,4 +1,4 @@
|
||||
import { getLang } from '../i18n'
|
||||
import { getLang, t } from '../i18n'
|
||||
import type { ThemeMode } from '../types'
|
||||
|
||||
/** Version de l'app (package.json). */
|
||||
@@ -55,7 +55,7 @@ export function techInfo(theme: ThemeMode): Record<string, string> {
|
||||
screen: `${screen.width}×${screen.height} @${Math.round((window.devicePixelRatio || 1) * 10) / 10}x`,
|
||||
viewport: `${window.innerWidth}×${window.innerHeight}`,
|
||||
route: currentRoute(),
|
||||
standalone: standalone ? 'yes' : 'no',
|
||||
online: navigator.onLine ? 'yes' : 'no',
|
||||
standalone: standalone ? t('common.yes') : t('common.no'),
|
||||
online: navigator.onLine ? t('common.yes') : t('common.no'),
|
||||
}
|
||||
}
|
||||
@@ -487,7 +487,9 @@ export async function verifyTotp(factorId: string, code: string): Promise<void>
|
||||
try {
|
||||
data = await gotrue(`/factors/${factorId}/verify`, { token, body: { challenge_id: challenge.id, code: clean } })
|
||||
} catch (e) {
|
||||
if (e instanceof AuthError && (e.code === 'mfa_verification_failed' || e.code === 'invalid_credentials')) throw new AuthError(t('mfa.err.code'))
|
||||
// Code refusé (faux ou expiré) : le serveur répond 400 / 422 selon le cas
|
||||
const status = (e as { status?: number }).status
|
||||
if (e instanceof AuthError && (e.code === 'mfa_verification_failed' || e.code === 'invalid_credentials' || status === 400 || status === 422)) throw new AuthError(t('mfa.err.code'))
|
||||
throw e
|
||||
}
|
||||
const s = toSession({ ...data, user: data.user ?? { id: current?.user.id, email: current?.user.email } })
|
||||
@@ -503,7 +505,9 @@ export async function enrollTotp(): Promise<{ id: string; qr: string; secret: st
|
||||
for (const f of await listTotpFactors()) if (!f.verified) await gotrue(`/factors/${f.id}`, { method: 'DELETE', token }).catch(() => {})
|
||||
const data = await gotrue('/factors', { token, body: { factor_type: 'totp', friendly_name: `Bobinoo ${Date.now().toString(36)}` } })
|
||||
const totp = data.totp as { qr_code?: unknown; secret?: unknown } | undefined
|
||||
const qr = typeof totp?.qr_code === 'string' && totp.qr_code.startsWith('data:image/svg+xml') ? totp.qr_code : ''
|
||||
// Le QR code arrive en SVG brut (ou déjà en data: URI) : affiché comme image, il ne peut rien exécuter
|
||||
const raw = typeof totp?.qr_code === 'string' ? totp.qr_code.trim() : ''
|
||||
const qr = raw.startsWith('data:image/svg+xml') ? raw : /^(<\?xml|<svg)/.test(raw) ? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(raw)}` : ''
|
||||
if (typeof data.id !== 'string' || !FACTOR_ID.test(data.id) || typeof totp?.secret !== 'string') throw new AuthError(t('auth.err.response'))
|
||||
return { id: data.id, qr, secret: totp.secret }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user