Skip to content
Discussion options

You must be logged in to vote

I ended up making an extension. Not sure if it good but it works.

///
extension GoTrueClientEx on GoTrueClient {
  /// Safe OAuth sign-in that waits for the user to complete the flow,
  /// detects app return/cancel, and applies a timeout.
  Future<AuthResponse> safeSignInWithOAuth(
    OAuthProvider provider, {
      String? redirectTo,
      String? scopes,
      LaunchMode authScreenLaunchMode = LaunchMode.platformDefault,
      Map<String, String>? queryParams,
      Duration timeout = const Duration(minutes: 3),
  }) async {
    final completer = Completer<AuthResponse>();
    // Listen for auth state changes
    await signOut(); // Clears all existing sessions - Preventing errors fr…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@KiddoV
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by KiddoV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants