Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Call auth.onAuthStateChange at least once when listener is registered. #313

@Xzoky174

Description

@Xzoky174

Feature request

Call auth.onAuthStateChange() at least once when registering the listener.

Is your feature request related to a problem? Please describe.

When getting the current user, I have to first get the user using auth.user(), then add a listener using auth.onAuthStateChange() and implement the same code there.

Describe the solution you'd like

I feel like it would be better if auth.onAuthStateChange() is called at least once when registering the listener, this removes unnecessary duplicate or spaghetti code. Additionally, this is also how firebase does it: https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseAuth.AuthStateListener

Describe alternatives you've considered

There is a solution as mentioned above, but doesn't result in the cleanest code.

Additional context

None.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions