Skip to content

Getting user data with async after page refresh takes long time #231

@orangesoup

Description

@orangesoup

I couldn't make a plunker, so I'm just gonna try to explain here. - I'm using SDK 3.0.

I have a simple Password auth (just an example, probably doesn't matter which one).

this.af.auth.login({ email, password }, {
  provider: AuthProviders.Password,
  method: AuthMethods.Password
});

Works fine, user can log in, data gets stored in localStorage, everything is shiny. However, when I refresh the page it takes almost 10 seconds to show the user data when using asyncpipe.

constructor(public _auth: FirebaseAuth, ...) { ... }
<div> {{ (_auth | async)?.uid }} </div>

Everything is loaded, I mean literally everything, and then after 8-10 seconds the uid just shows up. If I click the login button while waiting to uid to show up (so at this moment I have my data in localStorage already), the uid shows up instantly (it still makes a login request, but the uid shows up before that request actually finishes).

Honestly, I'm not sure if I'm doing something wrong here and this is an intended behavior (in this case please point me to the right direction), but it's really bad UX.


Not sure if it matters, but my main goal would be to show the users email address if they're logged in, but it's kinda weird when the page loads it shows nothing for ~10 seconds and then just suddenly pops out.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions