Skip to content

[1.1.1] Validation function ignored when user already logged-in #31

@legildas

Description

@legildas

Hello,

Since angular-meteor-auth 1.1.1, the optional validation function passed to awaitUser is being ignored when the user is already logged-in.

This is due to b7c78da (fixed #25) which introduced a bypass that doesn't use the validation function before resolving :

// If user is already logged in resolve the promise immediately to prevent an
// unnecessary computation
if (this.currentUser) {
    deferred.resolve(this.currentUser);
    // Keep the schema of the promise consistent
    deferred.promise.stop = angular.noop;
    return deferred.promise;
}

I already forked the repo and fixed it locally. Let me know if a PR sounds relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions