Skip to content

🐛 Bug Report: Google Auth screen not closing after authentication #220

@TanmayOG

Description

@TanmayOG

👟 Reproduction steps

  1. Run the app on an Android 14 device.
  2. Initiate the Google authentication flow using the googleAuth() function.
  3. Complete the authentication process.

Dart Code:

Future<void> googleAuth() async {
  try {
    await AppwriteService.account.createOAuth2Session(
      provider: OAuthProvider.google,
    );
    loadUser();
  } on AppwriteException catch (e) {
    handleAppwriteException(e);
  } catch (e) {
    print('An unexpected error occurred: $e');
  }
}

XML:

<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-[PROJECT-ID]" />
          </intent-filter>
</activity>

👍 Expected behavior

  • The authorization screen should close automatically after successful authentication.

  • User creation with OAuth should succeed without any errors.

👎 Actual Behavior

  1. The Google authorization screen remains open after authentication, requiring manual closure.

  2. The AppwriteException document_invalid_structure is thrown with the message:

Error creating user with OAuth: AppwriteException: document_invalid_structure,
Invalid document structure: Unknown attribute: "userId" (400)

🎲 Appwrite version

Version 2.0.x

💻 Operating system

Windows

🧱 Your Environment

  • Flutter SDK: ^3.5.3
  • Appwrite SDK: ^13.0.0
  • OS: Windows 11
  • Testing Device: Android 14

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requested

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions