
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
- createPhoneToken() new method email requ...
**Hello beautiful people!** It’s been a while — I retired at 27, but now I’m back! 😊 I’m running into an issue with Appwrite in Flutter. I used an older versi...
- Connecting a custom domain error
Hi, I'm trying to connect my domain from Hostinger using an auth.mydomain.com subdomain. I am getting this error: "Domain verification failed because CAA recor...
- SMS isn’t being received
I’m not receiving the sms code for phone auth.
