Skip to content

Timing issue in isLoggedIn #294

Description

@Rcjuk

in app.js

$rootScope.$on('$stateChangeStart', function (event, next) {
      if (next.authenticate && !Auth.isLoggedIn()) {
        $location.path('/login');
      }
    });

Auth.isLoggedIn is returning false when the app is first run and the user is already logged in. Only when you switch state a second time does the function return true as the currentuser has then been set in the auth service. Could there is a timing issue of some sort?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions