i tried implementing OAuth2 Google Login in my app, and it works fine for the most part, the problem am facing is when i chose a google account to sign in/up with, i get navigated back to the screen where i choose an account to sign in/up with, thus creating an endless loop, i can break this loop by navigating back after any successful sign in/up, but i believe the app should redirect back to the app automatically on a successful sign in/up, i followed the docs, and added this activity:
<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-68b4b7bb0033a245f7e0" />
</intent-filter>
</activity>
but it still not working, after searching the docs for a bit tho, i guess i should add a onSuccess and onFailure links in the .createOAuth2Session() function, so i bought a domain called "yashbook.online" just for this reason, and i did add it as a custom domain successfully, but now, i have no clue what should i do to finish setting it up, i tried looking for docs, but i couldnt find anything. btw here the function that am calling, just in case am making some mistake when calling it (which i doubt):
Future<User> loginWithGoogle() async { try { await _account.createOAuth2Session( provider: OAuthProvider.google, );
await Future.delayed(Duration(milliseconds: 100));
// After the session is created, fetch the user
final user = await _account.get();
_currentUser = user;
_status = AuthStatus.emailVerified;
return user;
} catch (e) {
rethrow;
}
}
Recommended threads
- Added Custom Domain - API requests with ...
I've added in a custom domain to Appwrite my domain itself is on cloudflare but has Appwrite name servers added and confirmed they work, I added the CAA in clou...
- Custom Email Templates Not Updating for ...
I have 4 custom email templates on my self-hosted Appwrite instance: - email verification - reset password - security alert - 2FA verification. email verifica...
- Table contents missing (attributes+rows)
Here is an image of the cloud and the attributes that should exist Some of the table do have the data but others dont. I am able to access the rows via api c...