Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

feat: fail to getSessionFromUrl throws error on onAuthStateChange #99

Merged
merged 6 commits into from
Oct 25, 2022

Conversation

dshukertjr
Copy link
Member

@dshukertjr dshukertjr commented Oct 24, 2022

Feature Proposal

Currently using supabase-flutter, there is no way to detect the exception thrown to parse deep links other than the initial link using initialSession

try {
  await SupabaseAuth.initialSession;
} catch(error) {
  // handle initial error here
}

This PR allows the users to use onAuthStateChange to listen to exceptions thrown during deep link parsing like this:

supabase.auth.onAuthStateChange.listen(
  (data) {
    // handle auth state change here
  },
  onError: (error) {
    // handle parsing error here.
  }
);

Fixes supabase/supabase-flutter#211

@dshukertjr dshukertjr marked this pull request as ready for review October 24, 2022 09:13
@dshukertjr dshukertjr requested a review from a team October 24, 2022 09:13
@dshukertjr dshukertjr merged commit c658af2 into main Oct 25, 2022
@dshukertjr dshukertjr deleted the feat/notify-exception branch October 25, 2022 14:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onReceivedAuthDeeplink custom function?
2 participants