L'authentification Keycloak WebView est maintenant 100% fonctionnelle avec navigation automatique vers le dashboard !
This commit is contained in:
@@ -73,11 +73,16 @@ class _LoginPageState extends State<LoginPage>
|
||||
builder: (context) => KeycloakWebViewAuthPage(
|
||||
onAuthSuccess: (user) {
|
||||
debugPrint('✅ Authentification réussie pour: ${user.fullName}');
|
||||
// Notifier le BLoC du succès
|
||||
context.read<AuthBloc>().add(AuthWebViewCallback('success'));
|
||||
// Fermer la WebView et naviguer vers le dashboard
|
||||
debugPrint('🔄 Notification du BLoC avec les données utilisateur...');
|
||||
|
||||
// Notifier le BLoC du succès avec les données utilisateur
|
||||
context.read<AuthBloc>().add(AuthWebViewCallback(
|
||||
'success',
|
||||
user: user,
|
||||
));
|
||||
|
||||
// Fermer la WebView - la navigation sera gérée par le BlocListener
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pushReplacementNamed('/dashboard');
|
||||
},
|
||||
onAuthError: (error) {
|
||||
debugPrint('❌ Erreur d\'authentification: $error');
|
||||
|
||||
@@ -117,11 +117,13 @@ class VisitorDashboard extends StatelessWidget {
|
||||
children: [
|
||||
const Icon(Icons.info_outline, color: Colors.white, size: 30),
|
||||
const SizedBox(width: SpacingTokens.sm),
|
||||
Text(
|
||||
'Découvrez notre communauté',
|
||||
style: TypographyTokens.headlineMedium.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Découvrez notre communauté',
|
||||
style: TypographyTokens.headlineMedium.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user