feature: do not login if in the login process
This commit is contained in:
		@ -2,7 +2,8 @@ window.requestLogin = false;
 | 
			
		||||
document.addEventListener("DOMContentLoaded", function () {
 | 
			
		||||
  const sibAuth = document.querySelector("sib-auth");
 | 
			
		||||
  const timeoutNoUser = setTimeout(() => {
 | 
			
		||||
    sibAuth.login();
 | 
			
		||||
    if(!(new URLSearchParams(window.location.search)).get('code'))
 | 
			
		||||
      sibAuth.login();
 | 
			
		||||
  }, 15000);
 | 
			
		||||
  if (sibAuth) {
 | 
			
		||||
    sibAuth.getUser()
 | 
			
		||||
@ -58,6 +59,7 @@ if (loginButton) {
 | 
			
		||||
    setTimeout(() => {
 | 
			
		||||
      document.querySelector('#something-goes-wrong').removeAttribute('hidden');
 | 
			
		||||
    }, 5000);
 | 
			
		||||
    document.querySelector('sib-auth').login();
 | 
			
		||||
    if(!(new URLSearchParams(window.location.search)).get('code'))
 | 
			
		||||
      document.querySelector('sib-auth').login();
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
@ -82,7 +82,8 @@ document.addEventListener("DOMContentLoaded", function () {
 | 
			
		||||
  if (window.location.pathname == "/login") {
 | 
			
		||||
    const sibAuth = document.querySelector("sib-auth");
 | 
			
		||||
    const timeoutNoUser = setTimeout(() => {
 | 
			
		||||
      sibAuth.login();
 | 
			
		||||
      if(!(new URLSearchParams(window.location.search)).get('code'))
 | 
			
		||||
        sibAuth.login();
 | 
			
		||||
    }, 15000);
 | 
			
		||||
    if (sibAuth) {
 | 
			
		||||
      sibAuth.getUser()
 | 
			
		||||
@ -129,7 +130,8 @@ document.addEventListener("DOMContentLoaded", function () {
 | 
			
		||||
    if (e.detail.route.startsWith('login')) {
 | 
			
		||||
      const sibAuth = document.querySelector("sib-auth");
 | 
			
		||||
      const timeoutNoUser2 = setTimeout(() => {
 | 
			
		||||
        sibAuth.login();
 | 
			
		||||
        if((new URLSearchParams(window.location.search)).get('code'))
 | 
			
		||||
          sibAuth.login();
 | 
			
		||||
      }, 15000);
 | 
			
		||||
      if (sibAuth) {
 | 
			
		||||
        sibAuth.getUser()
 | 
			
		||||
 | 
			
		||||
@ -14,7 +14,8 @@ import(`https://cdn.skypack.dev/@startinblox/core@${core.version}`).then(core =>
 | 
			
		||||
            }
 | 
			
		||||
          }),
 | 
			
		||||
        );
 | 
			
		||||
        document.querySelector("sib-auth").login();
 | 
			
		||||
        if(!(new URLSearchParams(window.location.search)).get('code'))
 | 
			
		||||
          document.querySelector("sib-auth").login();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,8 @@ document.addEventListener('DOMContentLoaded', () => {
 | 
			
		||||
  if (userCreationForm) {
 | 
			
		||||
    userCreationForm.addEventListener('save', event => {
 | 
			
		||||
      if (event.originalTarget.id == 'user-creation-form') {
 | 
			
		||||
        document.querySelector("sib-auth").login();
 | 
			
		||||
        if(!(new URLSearchParams(window.location.search)).get('code'))
 | 
			
		||||
          document.querySelector("sib-auth").login();
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user