Skip to content

feat(login): resetBeforeLogin option to enable/disable resetting of auth and profile on login #254

@zhang-z

Description

@zhang-z

I call firebase.login({token: token}) every time my app starts, which means login() could be called while the user is already logged in (yup this point can be improved, but the potential issue still exist). In this case, store.firebase.auth got reset to {isLoaded: true, isEmpty: true}. Firebase actions were dispatched in this sequence:

  1. AUTHENTICATION_INIT_STARTED
  2. AUTHENTICATION_INIT_FINISHED
  3. LOGIN -- already logged in, action contains auth: {...}
  4. LOGIN_ERROR -- dispatched by login(), see here

I feel the logic of 4th action is not quite right.

To replicate this issue, you can try to run login twice -- 2nd call fired after 1st call finished.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions