1

I'm using Auth0-Lock with Meteor and when I sign in and confirm connection with Guardian app (2FA), the page redirect me to my app and the auth0-lock appears again.

I had some trouble conditioning the auth0-lock display, and finally came up with this solution :

Tracker.autorun(() => {
        if(Meteor.loggingIn() == false) {
            if (Meteor.userId() == null) {
                const Lock = initLock();
                Lock.show();
            }
        }
    });

This allows me to display the auth0-lock when there is no user logged in and prevent its appearing when reloading the page (thanks to Meteor.loggingIn()).

But when I accept the guardian push notification and get redirected to my app, Meteor.loggingIn() returns false and Meteor.userId() is not defined yet, so the lock appears just before the user gets logged in.

How could I solve this problem ?

0 Answers0