FranciscoOriginal post
Web Developer
When the flow starts, the browser opens, I select an account, and it keeps showing:
"""
Page not found
The page you're looking for doesn't exist.
general_route_not_found
"""
Although the message remains displayed in the browser, the user appears in the Console.
The URL is: https://nyc.cloud.appwrite.io/console/auth/oauth2/success?project=the-recipes&domain=.nyc.cloud.appwrite.io&key=a_session_the-recipes&secret=
Plain text
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <application ...> <!-- ... --> <activity android:exported="true" android:name="com.linusu.flutter_web_auth_2.CallbackActivity" > <intent-filter android:label="flutter_web_auth_2"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="appwrite-callback-the-recipes" /> </intent-filter> </activity>
<!-- ... --> </application></manifest>Plain text
appwrite: 17.0.0Dart
import "package:appwrite/enums.dart" as enums;
Future<void> signInWithGoogle() async { try { EasyLoading.show(status: "auth_controller.signing_in".tr);
await _account.createOAuth2Session( provider: enums.OAuthProvider.google, ); await _checkCurrentUser(); EasyLoading.dismiss(); } on AppwriteException catch (e) { EasyLoading.dismiss(); print("Appwrite error: ${e.code} - ${e.message}"); EasyLoading.showError("auth_controller.sign_in_error".tr); } catch (e) { EasyLoading.dismiss(); print("General error: $e"); EasyLoading.showError("auth_controller.sign_in_error".tr); }}Summary
Issue: The Flutter OAuth2 Google process does not redirect back to the mobile app and displays a 'Page not found' error.
Solution:
- Check the AndroidManifest.xml file for the correct configuration for CallbackActivity.
- Ensure the pubspec.yml includes the correct version of the appwrite package.
- Review the Dart code for any errors or misconfigurations in the signInWithGoogle function.