The Auth0 blocking component does not appear in the React with Container box

(Using React) I have a route /loginand a route /signupto display components Loginand SignUp. In my component, LoginI use the Auth0 lock component to display the login form, and I also use containerthe configuration option for the form, which will be displayed in my own div, and not as a default modal option.

When my component Loginboots for the first time (or after updating the route /login), the Auth0 Lock component loads correctly. My problem is that I am moving from route /loginto route /signupand then back to route /login, and the Auth0 blocking component does not load at all. When checking the page, I’m mine container divempty.

I found this problem in Auth0 github of others who faced the same problem using Angular, but their solution is to install auth.config.auth0lib.$containerbefore nullwhich does not seem to be a good solution.

+4
source share
1 answer

auth0 Lock source hide, :

hide() {
  closeLock(this.id, true);
}

Login componentWillUnmount, Auth0Lock hide():

componentWillUnmount() {
  this.lock.hide();
}

, Login /login , /login, Auth0 Lock .

+3

Source: https://habr.com/ru/post/1679080/


All Articles