Skip to content

Conversation

@dshukertjr
Copy link
Member

What kind of change does this PR introduce?

Fixing a bug where two initialSession is emitted. Also fixing a bug where deeplink isn't handled on the web.

Closes #937
Closes #974

Supabase.instance.client.auth.setInitialSession(persistedSession);
await Supabase.instance.client.auth
.setInitialSession(persistedSession);
shouldEmitInitialSession = false;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason the shouldEmitInitialSession was never set to false, causing the initialSession to be emitted every single time.

Comment on lines +69 to +73
if (shouldEmitInitialSession) {
Supabase.instance.client.auth
// ignore: invalid_use_of_internal_member
.notifyAllSubscribers(AuthChangeEvent.initialSession);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this before the deep link handling to ensure the empty initial session is emitted first.

@dshukertjr dshukertjr merged commit 6323f9f into main Jul 19, 2024
@dshukertjr dshukertjr deleted the fix/duplicate-initial-session branch July 19, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supabase Auth on Flutter Web does not detect access token in url (Google & Apple) Handling initial deeplink in password recovery

3 participants