diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 7b0e425..5beb08c 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -40,6 +40,20 @@ + + + + + + + + + + + { + const code = req.body.code; + const state = req.body.state; + const id_token = req.body.id_token; + const user = req.body.user; + + const params = new URLSearchParams(); + if (code) params.append('code', code); + if (state) params.append('state', state); + if (id_token) params.append('id_token', id_token); + if (user) params.append('user', user); + + const qs = params.toString(); + const packageName = 'be.devdayronvl.travel_mate'; + const redirectUrl = `intent://callback?${qs}#Intent;package=${packageName};scheme=signinwithapple;end`; + + res.redirect(302, redirectUrl); +}); diff --git a/lib/components/loading/laoding_content.dart b/lib/components/loading/laoding_content.dart index 5cf4585..4bd8314 100644 --- a/lib/components/loading/laoding_content.dart +++ b/lib/components/loading/laoding_content.dart @@ -58,6 +58,9 @@ class _LoadingContentState extends State } } catch (e) { debugPrint('Erreur lors de la tâche en arrière-plan: $e'); + if (mounted) { + Navigator.pop(context); + } } } } diff --git a/lib/services/auth_service.dart b/lib/services/auth_service.dart index f57bed1..439b985 100644 --- a/lib/services/auth_service.dart +++ b/lib/services/auth_service.dart @@ -225,20 +225,20 @@ class AuthService { } // Request Apple ID credential with platform-specific configuration - final AuthorizationCredentialAppleID credential = - await SignInWithApple.getAppleIDCredential( - scopes: [ - AppleIDAuthorizationScopes.email, - AppleIDAuthorizationScopes.fullName, - ], - // Configuration for Android/Web - webAuthenticationOptions: WebAuthenticationOptions( - clientId: 'be.devdayronvl.travel_mate.service', - redirectUri: Uri.parse( - 'https://travelmate-a47f5.firebaseapp.com/__/auth/handler', - ), - ), - ); + final AuthorizationCredentialAppleID + credential = await SignInWithApple.getAppleIDCredential( + scopes: [ + AppleIDAuthorizationScopes.email, + AppleIDAuthorizationScopes.fullName, + ], + // Configuration for Android/Web + webAuthenticationOptions: WebAuthenticationOptions( + clientId: 'be.devdayronvl.TravelMate.service', + redirectUri: Uri.parse( + 'https://us-central1-travelmate-a47f5.cloudfunctions.net/callbacks_signInWithApple', + ), + ), + ); // Create OAuth credential for Firebase final OAuthCredential oauthCredential = OAuthProvider("apple.com")