Skip to content

[Authentication] Weird behavior !? #413

@manekinekko

Description

@manekinekko

Hi,

I was playing around with the Auth service, and I discovered a weird behavior...

Most of the time, when trying to log in using any provider (see screenshot), I always receive two streams values:

  1. The first one contains the correct auth info;
  2. A second one with a null value!! (which means that the user is not logged in).

image

However, after refreshing the app (i.e. hitting F5), I get one event back with the right session info:

image

And, when logging out, the app receives a null value, which is the expected behavior ofc:

image

Here is a portion of my code:

    this.af.auth.subscribe(
      user => {
        if(user) {
          this.isAuth = true;
        }
        else {
          this.isAuth = false;
        }
      },
      error => {
        console.trace(error);
      }
    );

Any idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions