feat(app): identity screens and /app shell — auth store, login/signup/reset flows, dashboard, account

- state/authStore: session subscription (initialize + onAuthStateChange), profile + roles load, recovery flag, URL failure; services/localeSync: profiles.locale <-> localeStore
- routes: /login, /signup, /forgot-password, /reset-password, /auth/callback; guards RequireAuth (next=) and RedirectIfSignedIn; /app (dashboard), /app/account behind the guard
- shell: AppLayout (desktop sidebar, light top bar, mobile drawer), SidebarNav, UserBadge, SignOutButton
- account: personal / professional / preferences / security sections, one save each, Zod validation with i18n keys
- ui: Icon, FormField, Notice, ButtonLink (buttonClassName shared), PasswordField, OAuthButtons (config-driven)
- Home header: Mon espace / Se connecter when Supabase is configured; local tool routes untouched
- i18n: auth.*, shell.*, dashboard.*, account.*, home.space.* in fr + en
This commit is contained in:
bchanot committed 2026-10-11 23:29:13 +02:00
1 parent 0f7292f9b3
commit c517ea267b
46 files changed
+2798 -11

No files matched your search

+191
View File
@@ -54,6 +54,9 @@ export const en: Dict = {
'home.no_sheet.description':
'This build of the application carries no anatomical sheet: no report can be created or imported.',
'home.space.signin': 'Sign in',
'home.space.open': 'My space',
// footer
'footer.all_rights_reserved': 'All rights reserved.',
'footer.powered_by': 'Powered by',
@@ -177,4 +180,192 @@ export const en: Dict = {
'lang.switch_to_en': 'Switch to English',
'lang.fr': 'FR',
'lang.en': 'EN',
// auth — shared
'auth.brand_claim': 'Your Faunosteo professional space.',
'auth.brand_note':
'The report tool stays available without an account. An account prepares what comes next: saved reports, animal follow-up, sharing with owners.',
'auth.unavailable_title': 'Signed-in space not available',
'auth.unavailable_description':
'This installation has no authentication server. The local report tool remains usable.',
'auth.back_to_tool': 'Back to the report tool',
'auth.email': 'Email address',
'auth.password': 'Password',
'auth.password_confirm': 'Confirm password',
'auth.password_hint':
'At least {min} characters, with a lowercase letter, an uppercase letter and a digit.',
'auth.show_password': 'Show password',
'auth.hide_password': 'Hide password',
'auth.or': 'or',
'auth.continue_with_google': 'Continue with Google',
'auth.continue_with_apple': 'Continue with Apple',
'auth.loading': 'Loading…',
// auth — login
'auth.login.title': 'Welcome back',
'auth.login.subtitle': 'Sign in to your space.',
'auth.login.submit': 'Sign in',
'auth.login.submitting': 'Signing in…',
'auth.login.forgot': 'Forgot your password?',
'auth.login.no_account': 'No account yet?',
'auth.login.signup_link': 'Create an account',
// auth — signup
'auth.signup.title': 'Create your account',
'auth.signup.subtitle': 'A few details, then a confirmation by email.',
'auth.signup.display_name': 'Display name',
'auth.signup.display_name_hint':
'How others will see you. You can change it later.',
'auth.signup.submit': 'Create my account',
'auth.signup.submitting': 'Creating…',
'auth.signup.have_account': 'Already have an account?',
'auth.signup.login_link': 'Sign in',
'auth.signup.check_inbox_title': 'Check your inbox',
'auth.signup.check_inbox_description':
'A confirmation link was sent to {email}. Open it to activate your account, then sign in.',
'auth.signup.check_inbox_spam':
'Nothing after a few minutes? Check your spam folder.',
// auth — forgot / reset
'auth.forgot.title': 'Forgot password',
'auth.forgot.subtitle':
'Enter your email address: we will send you a link to choose a new password.',
'auth.forgot.submit': 'Send the link',
'auth.forgot.submitting': 'Sending…',
'auth.forgot.sent_title': 'Link sent',
'auth.forgot.sent_description':
'If an account exists for {email}, an email is on its way. The link stays valid for one hour.',
'auth.forgot.back_to_login': 'Back to sign in',
'auth.reset.title': 'New password',
'auth.reset.subtitle': 'Choose a new password for your account.',
'auth.reset.submit': 'Save the password',
'auth.reset.submitting': 'Saving…',
'auth.reset.no_session_title': 'Invalid or expired link',
'auth.reset.no_session_description':
'This reset link can no longer be used. Request a new one.',
'auth.reset.request_again': 'Request a new link',
// auth — callback
'auth.callback.working': 'Signing you in…',
'auth.callback.failed_title': 'Sign-in failed',
'auth.callback.failed_description':
'No session could be opened: the link expired, was already used, or was opened in a different browser than the one that requested it. If you just confirmed your address, simply sign in.',
'auth.callback.retry': 'Try signing in again',
// auth — field errors (validation)
'auth.error.email_required': 'The email address is required.',
'auth.error.email_invalid': 'This email address is not valid.',
'auth.error.password_required': 'The password is required.',
'auth.error.password_rules':
'At least 12 characters, with a lowercase letter, an uppercase letter and a digit.',
'auth.error.password_mismatch': 'The two passwords do not match.',
'auth.error.display_name_required': 'The display name is required.',
'auth.error.display_name_too_long': 'The display name exceeds 80 characters.',
// auth — server failures
'auth.failure.invalid_credentials': 'Incorrect email or password.',
'auth.failure.email_not_confirmed':
'Your email address is not confirmed yet. Open the link you received by email.',
'auth.failure.user_exists': 'An account already exists with this email address.',
'auth.failure.weak_password':
'Password too weak: at least 12 characters, with a lowercase letter, an uppercase letter and a digit.',
'auth.failure.same_password': 'The new password must differ from the old one.',
'auth.failure.invalid_email': 'This email address is not accepted.',
'auth.failure.rate_limited':
'Too many attempts. Wait a few minutes before trying again.',
'auth.failure.link_expired': 'This link has expired or was already used.',
'auth.failure.session_expired': 'Your session has expired. Sign in again.',
'auth.failure.provider_disabled': 'This sign-in method is not enabled.',
'auth.failure.network': 'Cannot reach the server. Check your network.',
'auth.failure.unknown': 'An unexpected error occurred. Try again.',
// shell
'shell.nav_label': 'Main navigation',
'shell.open_menu': 'Open menu',
'shell.close_menu': 'Close menu',
'shell.nav.dashboard': 'Dashboard',
'shell.nav.account': 'My account',
'shell.nav.local_tool': 'Report tool',
'shell.nav.local_tool_hint': 'No account, PDF export',
'shell.sign_out': 'Sign out',
'shell.signing_out': 'Signing out…',
'shell.loading_session': 'Checking your session…',
'shell.role.owner': 'Platform owner',
'shell.role.admin': 'Administrator',
'shell.role.moderator': 'Moderator',
'shell.role.support': 'Support',
// dashboard
'dashboard.title': 'Dashboard',
'dashboard.greeting': 'Hello {name}',
'dashboard.greeting_fallback': 'Hello',
'dashboard.intro':
'Your Faunosteo space is ready. Online reports will come in a later version; until then the report tool remains available.',
'dashboard.profile.title': 'Your profile',
'dashboard.profile.incomplete':
'Fill in your professional details: they will appear on your future reports.',
'dashboard.profile.complete': 'Your details are filled in.',
'dashboard.profile.missing_label': 'To complete:',
'dashboard.profile.cta_complete': 'Complete my profile',
'dashboard.profile.cta_view': 'View my account',
'dashboard.tool.title': 'Report tool',
'dashboard.tool.description':
'Create or resume a report as today: it works without an account and exports a PDF that carries its own data.',
'dashboard.tool.cta_new': 'New report',
'dashboard.tool.cta_import': 'Import a PDF',
'dashboard.account.title': 'Account',
'dashboard.account.email': 'Email',
'dashboard.account.verified': 'Address confirmed',
'dashboard.account.unverified': 'Address not confirmed',
'dashboard.account.language': 'Language',
'dashboard.account.roles': 'Platform roles',
'dashboard.account.no_roles': 'No platform role',
'dashboard.account.member_since': 'Account created on {date}',
// account
'account.title': 'My account',
'account.save': 'Save',
'account.saving': 'Saving…',
'account.saved': 'Changes saved.',
'account.optional': 'optional',
'account.error.save_failed': 'Saving failed. Check the fields and try again.',
'account.error.required': 'This field is required.',
'account.error.too_long': 'Text too long ({max} characters maximum).',
'account.error.phone_format':
'International format, for example +33612345678.',
'account.error.siret_format': 'A SIRET has exactly 14 digits.',
'account.personal.title': 'Personal information',
'account.personal.description': 'How you appear in Faunosteo.',
'account.personal.display_name': 'Display name',
'account.personal.first_name': 'First name',
'account.personal.last_name': 'Last name',
'account.personal.phone': 'Phone',
'account.personal.phone_hint':
'International format. SMS verification comes later.',
'account.professional.title': 'Professional information',
'account.professional.description':
'Declarative for now: professional verification comes in a later step.',
'account.professional.professional_title': 'Professional title',
'account.professional.professional_title_placeholder': 'Animal osteopath',
'account.professional.practice_name': 'Practice or organisation',
'account.professional.siret': 'SIRET',
'account.professional.siret_hint': '14 digits, no spaces.',
'account.preferences.title': 'Preferences',
'account.preferences.description':
'The language is saved on your account and applies on every device.',
'account.preferences.language': 'Language',
'account.preferences.timezone': 'Time zone',
'account.preferences.timezone_hint': 'Used for dates and future appointments.',
'account.security.title': 'Security',
'account.security.description': 'Password and sessions.',
'account.security.email_label': 'Sign-in address',
'account.security.new_password': 'New password',
'account.security.change_password': 'Change password',
'account.security.changing_password': 'Updating…',
'account.security.password_changed': 'Password updated.',
'account.security.mfa_title': 'Two-factor authentication',
'account.security.mfa_note':
'Not available in this version yet. It will be offered, then required for platform roles.',
'account.security.sign_out_everywhere_note':
'Signing out closes the session on this device.',
}
+193
View File
@@ -56,6 +56,9 @@ export const fr: Dict = {
'home.no_sheet.description':
"Cette version de l'application n'embarque aucune fiche anatomique : aucun bilan ne peut être créé ni importé.",
'home.space.signin': 'Se connecter',
'home.space.open': 'Mon espace',
// footer
'footer.all_rights_reserved': 'Tous droits réservés.',
'footer.powered_by': 'Propulsé par',
@@ -193,4 +196,194 @@ export const fr: Dict = {
'lang.switch_to_en': 'Switch to English',
'lang.fr': 'FR',
'lang.en': 'EN',
// auth — shared
'auth.brand_claim': 'Votre espace professionnel Faunosteo.',
'auth.brand_note':
"L'outil de bilan reste accessible sans compte. Un compte prépare la suite : bilans enregistrés, suivi des animaux, partage avec les propriétaires.",
'auth.unavailable_title': 'Espace connecté non disponible',
'auth.unavailable_description':
"Cette installation ne dispose pas de serveur d'authentification. L'outil de bilan local reste utilisable.",
'auth.back_to_tool': "Retour à l'outil de bilan",
'auth.email': 'Adresse e-mail',
'auth.password': 'Mot de passe',
'auth.password_confirm': 'Confirmer le mot de passe',
'auth.password_hint':
'Au moins {min} caractères, avec une minuscule, une majuscule et un chiffre.',
'auth.show_password': 'Afficher le mot de passe',
'auth.hide_password': 'Masquer le mot de passe',
'auth.or': 'ou',
'auth.continue_with_google': 'Continuer avec Google',
'auth.continue_with_apple': 'Continuer avec Apple',
'auth.loading': 'Chargement…',
// auth — login
'auth.login.title': 'Bon retour',
'auth.login.subtitle': 'Connectez-vous à votre espace.',
'auth.login.submit': 'Se connecter',
'auth.login.submitting': 'Connexion…',
'auth.login.forgot': 'Mot de passe oublié ?',
'auth.login.no_account': 'Pas encore de compte ?',
'auth.login.signup_link': 'Créer un compte',
// auth — signup
'auth.signup.title': 'Créer votre compte',
'auth.signup.subtitle': "Quelques informations, puis une confirmation par e-mail.",
'auth.signup.display_name': 'Nom affiché',
'auth.signup.display_name_hint':
'Tel que vos interlocuteurs le verront. Modifiable ensuite.',
'auth.signup.submit': 'Créer mon compte',
'auth.signup.submitting': 'Création…',
'auth.signup.have_account': 'Déjà un compte ?',
'auth.signup.login_link': 'Se connecter',
'auth.signup.check_inbox_title': 'Vérifiez votre boîte mail',
'auth.signup.check_inbox_description':
'Un lien de confirmation a été envoyé à {email}. Ouvrez-le pour activer votre compte, puis connectez-vous.',
'auth.signup.check_inbox_spam':
"Rien reçu après quelques minutes ? Vérifiez vos courriers indésirables.",
// auth — forgot / reset
'auth.forgot.title': 'Mot de passe oublié',
'auth.forgot.subtitle':
'Indiquez votre adresse e-mail : nous vous envoyons un lien pour choisir un nouveau mot de passe.',
'auth.forgot.submit': 'Envoyer le lien',
'auth.forgot.submitting': 'Envoi…',
'auth.forgot.sent_title': 'Lien envoyé',
'auth.forgot.sent_description':
'Si un compte existe pour {email}, un e-mail vient de partir. Le lien reste valable une heure.',
'auth.forgot.back_to_login': 'Retour à la connexion',
'auth.reset.title': 'Nouveau mot de passe',
'auth.reset.subtitle': 'Choisissez un nouveau mot de passe pour votre compte.',
'auth.reset.submit': 'Enregistrer le mot de passe',
'auth.reset.submitting': 'Enregistrement…',
'auth.reset.no_session_title': 'Lien invalide ou expiré',
'auth.reset.no_session_description':
'Ce lien de réinitialisation ne peut plus être utilisé. Demandez-en un nouveau.',
'auth.reset.request_again': 'Demander un nouveau lien',
// auth — callback
'auth.callback.working': 'Connexion en cours…',
'auth.callback.failed_title': 'Connexion impossible',
'auth.callback.failed_description':
"Aucune session n'a pu être ouverte : lien expiré, déjà utilisé, ou ouvert dans un autre navigateur que celui de la demande. Si vous venez de confirmer votre adresse, connectez-vous simplement.",
'auth.callback.retry': 'Réessayer de se connecter',
// auth — field errors (validation)
'auth.error.email_required': "L'adresse e-mail est requise.",
'auth.error.email_invalid': "Cette adresse e-mail n'est pas valide.",
'auth.error.password_required': 'Le mot de passe est requis.',
'auth.error.password_rules':
'Au moins 12 caractères, avec une minuscule, une majuscule et un chiffre.',
'auth.error.password_mismatch': 'Les deux mots de passe ne correspondent pas.',
'auth.error.display_name_required': 'Le nom affiché est requis.',
'auth.error.display_name_too_long': 'Le nom affiché dépasse 80 caractères.',
// auth — server failures
'auth.failure.invalid_credentials': 'E-mail ou mot de passe incorrect.',
'auth.failure.email_not_confirmed':
"Votre adresse e-mail n'est pas encore confirmée. Ouvrez le lien reçu par e-mail.",
'auth.failure.user_exists': 'Un compte existe déjà avec cette adresse e-mail.',
'auth.failure.weak_password':
'Mot de passe trop faible : au moins 12 caractères, avec une minuscule, une majuscule et un chiffre.',
'auth.failure.same_password': "Le nouveau mot de passe doit être différent de l'ancien.",
'auth.failure.invalid_email': "Cette adresse e-mail n'est pas acceptée.",
'auth.failure.rate_limited':
'Trop de tentatives. Patientez quelques minutes avant de réessayer.',
'auth.failure.link_expired': 'Ce lien a expiré ou a déjà été utilisé.',
'auth.failure.session_expired': 'Votre session a expiré. Reconnectez-vous.',
'auth.failure.provider_disabled': "Ce mode de connexion n'est pas activé.",
'auth.failure.network': 'Connexion au serveur impossible. Vérifiez votre réseau.',
'auth.failure.unknown': "Une erreur inattendue s'est produite. Réessayez.",
// shell
'shell.nav_label': 'Navigation principale',
'shell.open_menu': 'Ouvrir le menu',
'shell.close_menu': 'Fermer le menu',
'shell.nav.dashboard': 'Tableau de bord',
'shell.nav.account': 'Mon compte',
'shell.nav.local_tool': 'Outil de bilan',
'shell.nav.local_tool_hint': 'Sans compte, export PDF',
'shell.sign_out': 'Se déconnecter',
'shell.signing_out': 'Déconnexion…',
'shell.loading_session': 'Vérification de la session…',
'shell.role.owner': 'Propriétaire plateforme',
'shell.role.admin': 'Administrateur',
'shell.role.moderator': 'Modérateur',
'shell.role.support': 'Support',
// dashboard
'dashboard.title': 'Tableau de bord',
'dashboard.greeting': 'Bonjour {name}',
'dashboard.greeting_fallback': 'Bonjour',
'dashboard.intro':
"Votre espace Faunosteo est prêt. Les bilans en ligne arriveront dans une prochaine version ; d'ici là, l'outil de bilan reste disponible.",
'dashboard.profile.title': 'Votre profil',
'dashboard.profile.incomplete':
'Renseignez vos informations professionnelles : elles figureront sur vos futurs bilans.',
'dashboard.profile.complete': 'Vos informations sont renseignées.',
'dashboard.profile.missing_label': 'À compléter :',
'dashboard.profile.cta_complete': 'Compléter mon profil',
'dashboard.profile.cta_view': 'Voir mon compte',
'dashboard.tool.title': 'Outil de bilan',
'dashboard.tool.description':
"Créez ou reprenez un bilan comme aujourd'hui : il fonctionne sans compte et exporte un PDF qui contient ses propres données.",
'dashboard.tool.cta_new': 'Nouveau bilan',
'dashboard.tool.cta_import': 'Importer un PDF',
'dashboard.account.title': 'Compte',
'dashboard.account.email': 'E-mail',
'dashboard.account.verified': 'Adresse confirmée',
'dashboard.account.unverified': 'Adresse non confirmée',
'dashboard.account.language': 'Langue',
'dashboard.account.roles': 'Rôles plateforme',
'dashboard.account.no_roles': 'Aucun rôle plateforme',
'dashboard.account.member_since': 'Compte créé le {date}',
// account
'account.title': 'Mon compte',
'account.save': 'Enregistrer',
'account.saving': 'Enregistrement…',
'account.saved': 'Modifications enregistrées.',
'account.optional': 'facultatif',
'account.error.save_failed':
"L'enregistrement a échoué. Vérifiez les champs et réessayez.",
'account.error.required': 'Ce champ est requis.',
'account.error.too_long': 'Texte trop long ({max} caractères maximum).',
'account.error.phone_format':
'Numéro au format international, par exemple +33612345678.',
'account.error.siret_format': 'Le SIRET comporte exactement 14 chiffres.',
'account.personal.title': 'Informations personnelles',
'account.personal.description': 'Comment vous apparaissez dans Faunosteo.',
'account.personal.display_name': 'Nom affiché',
'account.personal.first_name': 'Prénom',
'account.personal.last_name': 'Nom',
'account.personal.phone': 'Téléphone',
'account.personal.phone_hint':
'Format international. La vérification par SMS viendra plus tard.',
'account.professional.title': 'Informations professionnelles',
'account.professional.description':
'Déclaratives pour le moment : la vérification professionnelle arrivera dans une prochaine étape.',
'account.professional.professional_title': 'Titre professionnel',
'account.professional.professional_title_placeholder': 'Ostéopathe animalier',
'account.professional.practice_name': 'Cabinet ou structure',
'account.professional.siret': 'SIRET',
'account.professional.siret_hint': '14 chiffres, sans espaces.',
'account.preferences.title': 'Préférences',
'account.preferences.description':
"La langue est enregistrée sur votre compte et s'applique sur tous vos appareils.",
'account.preferences.language': 'Langue',
'account.preferences.timezone': 'Fuseau horaire',
'account.preferences.timezone_hint':
'Utilisé pour les dates et les futurs rendez-vous.',
'account.security.title': 'Sécurité',
'account.security.description': 'Mot de passe et sessions.',
'account.security.email_label': 'Adresse de connexion',
'account.security.new_password': 'Nouveau mot de passe',
'account.security.change_password': 'Changer le mot de passe',
'account.security.changing_password': 'Mise à jour…',
'account.security.password_changed': 'Mot de passe mis à jour.',
'account.security.mfa_title': 'Double authentification',
'account.security.mfa_note':
'Pas encore disponible dans cette version. Elle sera proposée, puis exigée pour les rôles plateforme.',
'account.security.sign_out_everywhere_note':
'Se déconnecter ferme la session sur cet appareil.',
}