feat(auth): connect Flutter login to MSAL
This commit is contained in:
@@ -14,9 +14,18 @@ import "restitution_select_screen.dart";
|
||||
class HomeScreen extends StatelessWidget {
|
||||
const HomeScreen({super.key});
|
||||
|
||||
void _quitter(BuildContext context) {
|
||||
AuthService.clearSession();
|
||||
Navigator.of(context).pop();
|
||||
Future<void> _quitter(BuildContext context) async {
|
||||
try {
|
||||
await AuthService.signOut();
|
||||
if (context.mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
} catch (error) {
|
||||
if (!context.mounted) return;
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text(error.toString())));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -48,7 +57,7 @@ class HomeScreen extends StatelessWidget {
|
||||
campusTag: DemoIdentity.campusTag,
|
||||
userName: DemoIdentity.userName,
|
||||
userInitials: DemoIdentity.userInitials,
|
||||
onBack: () => _quitter(context),
|
||||
onBack: () async => _quitter(context),
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
|
||||
Reference in New Issue
Block a user