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
- Rate limit
How do I solve "Signup Failed, Rate limit for the current endpoint has been exceeded. Please try again after some time"? I have Pro and around 2k requests per ...
- Type 'Theme' does not satisfy the constr...
Type 'Theme' does not satisfy the constraint 'Row'. Type 'Theme' is missing the following properties from type 'Row': $id, $sequence, $tableId, $databaseId, a...
- Dev Keys not working
looks like dev key are broken they simply don't work i suggest remove them until you have them working otherwise they confuse devs took me few minutes trying ...