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
@@ -2,6 +2,7 @@ import { t } from '../i18n'
|
||||
import { LanguageSelect } from '../i18n/react'
|
||||
import { Eye, EyeOff, Loader2 } from 'lucide-react'
|
||||
import { useEffect, useState, type FormEvent, type ReactNode } from 'react'
|
||||
import { useBackToClose } from '../lib/backNav'
|
||||
import { PASSWORD_MIN, requestPasswordReset, signIn, signInWithGoogle, signOut, signUp, updatePassword, verifyTotp } from '../lib/cloud/auth'
|
||||
import { USERNAME_RE } from '../lib/cloud/social'
|
||||
import { cx } from '../lib/utils'
|
||||
@@ -33,7 +34,9 @@ function PasswordField({ value, onChange, placeholder, autoComplete }: { value:
|
||||
|
||||
function Shell({ children, subtitle }: { children: ReactNode; subtitle: string }) {
|
||||
return (
|
||||
<div className="safe-top safe-bottom flex min-h-dvh flex-col items-center justify-center bg-bg px-5 py-10">
|
||||
// Marges du téléphone (encoche, barre d'accueil) à part : sinon elles remplaçaient l'espace du haut
|
||||
<div className="safe-top safe-bottom bg-bg">
|
||||
<div className="flex min-h-dvh flex-col items-center justify-center px-5 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<h1 className="text-center text-[2.4rem] font-bold leading-none">
|
||||
Bobin<span className="text-accent">oo</span>
|
||||
@@ -45,11 +48,25 @@ function Shell({ children, subtitle }: { children: ReactNode; subtitle: string }
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** Écran de connexion / inscription (affiché quand les comptes sont activés et qu'on n'est pas connecté). */
|
||||
export default function AuthScreen({ notice, onExplore, initialMode = 'login' }: { notice?: string; /** Mode découverte : regarder l'app sans compte */ onExplore?: () => void; initialMode?: 'login' | 'signup' }) {
|
||||
export default function AuthScreen({
|
||||
notice,
|
||||
onExplore,
|
||||
initialMode = 'login',
|
||||
onBack,
|
||||
}: {
|
||||
notice?: string
|
||||
/** Mode découverte : regarder l'app sans compte */
|
||||
onExplore?: () => void
|
||||
initialMode?: 'login' | 'signup'
|
||||
/** Ouvert depuis le mode découverte : le bouton « retour » du navigateur y ramène */
|
||||
onBack?: () => void
|
||||
}) {
|
||||
useBackToClose(() => onBack?.(), !!onBack)
|
||||
const [mode, setMode] = useState<Mode>(initialMode)
|
||||
const [email, setEmail] = useState('')
|
||||
const [username, setUsername] = useState('')
|
||||
@@ -283,7 +300,7 @@ export function NewPasswordScreen({ onDone }: { onDone: () => void }) {
|
||||
export function TotpField({ value, onChange, autoFocus }: { value: string; onChange: (v: string) => void; autoFocus?: boolean }) {
|
||||
return (
|
||||
<input
|
||||
className="field text-center text-xl tracking-[0.3em] tabular-nums"
|
||||
className="field text-center text-xl tracking-[0.3em] tabular-nums placeholder:text-base placeholder:tracking-normal"
|
||||
inputMode="numeric"
|
||||
autoComplete="one-time-code"
|
||||
pattern="[0-9 ]{6,7}"
|
||||
|
||||
@@ -10,10 +10,12 @@ interface Props {
|
||||
confirmLabel?: string
|
||||
onConfirm: () => void
|
||||
onCancel: () => void
|
||||
/** Action irréversible (effacer, supprimer, bloquer…) : bouton rouge */
|
||||
danger?: boolean
|
||||
}
|
||||
|
||||
/** Fenêtre « Êtes-vous sûr ? » intégrée à l'app (plus fiable que window.confirm sur mobile). */
|
||||
export default function ConfirmDialog({ open, title, message, confirmLabel = t('common.confirm'), onConfirm, onCancel }: Props) {
|
||||
export default function ConfirmDialog({ open, title, message, confirmLabel = t('common.confirm'), onConfirm, onCancel, danger }: Props) {
|
||||
useEscape(onCancel, open)
|
||||
useBackToClose(onCancel, open)
|
||||
const titleId = useId()
|
||||
@@ -36,7 +38,7 @@ export default function ConfirmDialog({ open, title, message, confirmLabel = t('
|
||||
<button onClick={onCancel} className="btn btn-ghost" autoFocus>
|
||||
{t('common.cancel')}
|
||||
</button>
|
||||
<button onClick={onConfirm} className="btn btn-primary">
|
||||
<button onClick={onConfirm} className={danger ? 'btn bg-danger text-on-danger' : 'btn btn-primary'}>
|
||||
{confirmLabel}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -172,6 +172,7 @@ function ListDetail({ list, onBack, onOpen }: { list: CustomList; onBack: () =>
|
||||
title={t('confirm.title')}
|
||||
message={t('lists.deleteConfirm', { name: list.name })}
|
||||
confirmLabel={t('common.delete')}
|
||||
danger
|
||||
onConfirm={async () => {
|
||||
setConfirm(false)
|
||||
await deleteList(list.id)
|
||||
|
||||
@@ -3,6 +3,7 @@ import { useEffect, useState, type FormEvent } from 'react'
|
||||
import { t } from '../i18n'
|
||||
import { enrollTotp, listTotpFactors, removeTotp, verifyTotp } from '../lib/cloud/auth'
|
||||
import { TotpField } from './AuthScreen'
|
||||
import ConfirmDialog from './ConfirmDialog'
|
||||
|
||||
/** Réglages → Mon compte : activer / désactiver la double authentification (application d'authentification). */
|
||||
export default function TwoFactor({ onMessage }: { onMessage: (kind: 'ok' | 'error', text: string) => void }) {
|
||||
@@ -11,6 +12,7 @@ export default function TwoFactor({ onMessage }: { onMessage: (kind: 'ok' | 'err
|
||||
const [setup, setSetup] = useState<{ id: string; qr: string; secret: string }>()
|
||||
const [code, setCode] = useState('')
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [confirmOff, setConfirmOff] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
let alive = true
|
||||
@@ -52,6 +54,7 @@ export default function TwoFactor({ onMessage }: { onMessage: (kind: 'ok' | 'err
|
||||
}
|
||||
|
||||
const disable = async () => {
|
||||
setConfirmOff(false)
|
||||
if (!factor) return
|
||||
setBusy(true)
|
||||
try {
|
||||
@@ -74,7 +77,7 @@ export default function TwoFactor({ onMessage }: { onMessage: (kind: 'ok' | 'err
|
||||
<span className="mt-0.5 block text-xs text-ink-3">{factor === undefined ? '…' : factor ? t('mfa.on') : t('mfa.off')}</span>
|
||||
</span>
|
||||
{factor !== undefined && !setup && (
|
||||
<button onClick={() => void (factor ? disable() : start())} disabled={busy} className="btn btn-ghost shrink-0 px-3 py-1.5 text-sm">
|
||||
<button onClick={() => (factor ? setConfirmOff(true) : void start())} disabled={busy} className="btn btn-ghost shrink-0 px-3 py-1.5 text-sm">
|
||||
{busy && <Loader2 size={14} className="animate-spin" />}
|
||||
{factor ? t('mfa.disable') : t('mfa.enable')}
|
||||
</button>
|
||||
@@ -104,6 +107,7 @@ export default function TwoFactor({ onMessage }: { onMessage: (kind: 'ok' | 'err
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
<ConfirmDialog open={confirmOff} title={t('mfa.disable')} message={t('mfa.disableConfirm')} confirmLabel={t('mfa.disable')} onConfirm={() => void disable()} onCancel={() => setConfirmOff(false)} danger />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -8,7 +8,7 @@ export default function GuestPrompt({ onSignIn, onSignUp, onClose }: { onSignIn:
|
||||
useEscape(onClose)
|
||||
useBackToClose(onClose)
|
||||
return (
|
||||
<div className="fixed inset-0 z-[80] flex items-end justify-center bg-black/60 sm:items-center" onClick={onClose}>
|
||||
<div className="fixed inset-0 z-[80] flex items-end justify-center bg-scrim sm:items-center" onClick={onClose}>
|
||||
<div
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
@@ -27,7 +27,7 @@ export default function GuestPrompt({ onSignIn, onSignUp, onClose }: { onSignIn:
|
||||
</h2>
|
||||
<p className="mt-1.5 text-sm leading-relaxed text-ink-2">{t('guest.promptText')}</p>
|
||||
<div className="mt-6 space-y-2">
|
||||
<button onClick={onSignUp} className="btn btn-primary w-full py-3">
|
||||
<button onClick={onSignUp} className="btn btn-primary w-full py-3" autoFocus>
|
||||
{t('auth.signupTab')}
|
||||
</button>
|
||||
<button onClick={onSignIn} className="btn btn-ghost w-full py-3">
|
||||
|
||||
@@ -83,6 +83,7 @@ export default function SelectionBar({ selected, onDone }: Props) {
|
||||
title={t('confirm.title')}
|
||||
message={t('select.deleteConfirm', { count: selected.length })}
|
||||
confirmLabel={t('common.delete')}
|
||||
danger
|
||||
onConfirm={() => void run(() => actions.deleteItems(ids))}
|
||||
onCancel={() => setPanel(null)}
|
||||
/>
|
||||
|
||||
@@ -340,6 +340,7 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
||||
title={t('block.confirmTitle', { name: profile?.displayName ?? '' })}
|
||||
message={t('block.confirmText')}
|
||||
confirmLabel={t('block.block')}
|
||||
danger
|
||||
onConfirm={doBlock}
|
||||
onCancel={() => setConfirmBlock(false)}
|
||||
/>
|
||||
|
||||
@@ -403,6 +403,7 @@ export function SharedListSheet({ id, onClose }: { id: string; onClose: () => vo
|
||||
title={t('confirm.title')}
|
||||
message={list ? (confirm === 'delete' ? t('shared.deleteConfirm', { name: list.name }) : t('shared.leaveConfirm', { name: list.name })) : undefined}
|
||||
confirmLabel={confirm === 'delete' ? t('common.delete') : t('shared.leaveShort')}
|
||||
danger
|
||||
onCancel={() => setConfirm(null)}
|
||||
onConfirm={async () => {
|
||||
if (!list) return
|
||||
|
||||
@@ -260,8 +260,6 @@ export default function AddTitle({
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
|
||||
<p className="mt-6 text-center text-[11px] leading-relaxed text-ink-3">{t('search.privacy', { source: hasKey ? 'TMDB / AniList' : 'AniList' })}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,7 +58,9 @@ interface Props {
|
||||
* Vu / En cours / À voir, note, coup de cœur, avis, épisodes, casting et note moyenne du public.
|
||||
*/
|
||||
export default function TitleSheet({ item: initial, seed, onClose, onOpenPerson, focus: initialFocus, onDone }: Props) {
|
||||
const { items, settings, add, update, lists, patchMany } = useMedia()
|
||||
const { items, settings, add, update, lists, patchMany, guest, requestAccount } = useMedia()
|
||||
// Mode découverte : écrire un avis demande un compte (avant de taper, pas au moment d'enregistrer)
|
||||
const openReview = () => (guest ? requestAccount() : setReviewing(true))
|
||||
const actions = useLibraryActions()
|
||||
const social = useSocial()
|
||||
useScrollLock()
|
||||
@@ -560,7 +562,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onOpenPerson,
|
||||
<section className="mx-4 mt-4">
|
||||
{item?.notes ? (
|
||||
<div className="card p-4">
|
||||
<button onClick={() => setReviewing(true)} className="block w-full text-start">
|
||||
<button onClick={openReview} className="block w-full text-start">
|
||||
<span className="eyebrow flex items-center justify-between">
|
||||
<span className="flex items-center gap-2">
|
||||
{t('form.review')}
|
||||
@@ -577,7 +579,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onOpenPerson,
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<button onClick={() => setReviewing(true)} disabled={busy} className="flex w-full items-center gap-2 rounded-2xl border border-dashed border-line-strong px-4 py-3.5 text-start text-sm text-ink-2">
|
||||
<button onClick={openReview} disabled={busy} className="flex w-full items-center gap-2 rounded-2xl border border-dashed border-line-strong px-4 py-3.5 text-start text-sm text-ink-2">
|
||||
<Pencil size={16} className="text-accent" /> {t('title.writeReview')}
|
||||
</button>
|
||||
)}
|
||||
@@ -700,6 +702,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onOpenPerson,
|
||||
title={t('confirm.title')}
|
||||
message={item ? t('form.deleteConfirm', { title: item.title }) : undefined}
|
||||
confirmLabel={t('common.delete')}
|
||||
danger
|
||||
onConfirm={onDelete}
|
||||
onCancel={() => setConfirmDelete(false)}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user