feat(#112): lien login « J'ai un numéro de dossier » + reprise-identify
Modale numéro + e-mail, obtention du token puis redirection vers /reprise. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import '../../widgets/image_button.dart';
|
||||
import '../../widgets/custom_app_text_field.dart';
|
||||
import '../../services/auth_service.dart';
|
||||
import '../../widgets/auth/change_password_dialog.dart';
|
||||
import '../../widgets/auth/reprise_identify_dialog.dart';
|
||||
|
||||
class LoginScreen extends StatefulWidget {
|
||||
const LoginScreen({super.key});
|
||||
@@ -100,6 +101,31 @@ class _LoginPageState extends State<LoginScreen> {
|
||||
_handleLogin();
|
||||
}
|
||||
|
||||
Future<void> _openRepriseIdentify() async {
|
||||
final token = await showDialog<String>(
|
||||
context: context,
|
||||
builder: (ctx) => RepriseIdentifyDialog(
|
||||
initialEmail: _emailController.text.trim(),
|
||||
),
|
||||
);
|
||||
if (!mounted || token == null || token.isEmpty) return;
|
||||
context.go('/reprise?token=${Uri.encodeComponent(token)}');
|
||||
}
|
||||
|
||||
Widget _buildRepriseDossierLink({double fontSize = 14}) {
|
||||
return TextButton(
|
||||
onPressed: _isLoading ? null : _openRepriseIdentify,
|
||||
child: Text(
|
||||
'J’ai un numéro de dossier',
|
||||
style: GoogleFonts.merienda(
|
||||
fontSize: fontSize,
|
||||
color: const Color(0xFF2D6A4F),
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Gère la connexion de l'utilisateur
|
||||
Future<void> _handleLogin() async {
|
||||
// Réinitialiser le message d'erreur
|
||||
@@ -351,6 +377,8 @@ class _LoginPageState extends State<LoginScreen> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Center(child: _buildRepriseDossierLink()),
|
||||
const SizedBox(height: 10),
|
||||
// Lien mot de passe oublié
|
||||
Center(
|
||||
child: TextButton(
|
||||
@@ -617,6 +645,7 @@ class _LoginPageState extends State<LoginScreen> {
|
||||
onPressed: _handleLogin,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildRepriseDossierLink(),
|
||||
TextButton(
|
||||
onPressed: () => context.go('/forgot-password'),
|
||||
child: Text(
|
||||
|
||||
Reference in New Issue
Block a user