title: How to Stop msalInstance.loginRedirect redirecting to Microsoft login page MSAL.js
body: <p>I have a web application which initially check for office365 logged in user another tab, if logged in, application will get user the data.</p>
  
  <p>If user is not logged in another tab it will redirecting to <a href="https://login.microsoftonline.com/" rel="nofollow noreferrer">https://login.microsoftonline.com/</a> but it should redirect to application login page.</p>
  
  <p>Is there any way to show application login page instead of Microsoft login page.</p>
  
  <pre><code> let msalConfig = {
          auth: {
              clientId: client_id,
              authority: 'https://login.microsoftonline.com/'+tenet_id,
              navigateToLoginRequestUrl: false,
              redirect_uri: 'https://localhost:3300/login',
              resource: 'https://management.azure.com/'
          },
          cache: {
              cacheLocation: "localStorage",
              storeAuthStateInCookie: true
          }
      };
      var msalInstance = new Msal.UserAgentApplication(msalConfig);
      var tokenRequest = {
          scopes: ["user.read"],
      }
  
      function login() {
          msalInstance.handleRedirectCallback((error, response) =&gt; {
              if (error) console.error(error);
              console.log(response);
          })
          msalInstance.loginRedirect(tokenRequest);
      }
  
      msalInstance.acquireTokenSilent(tokenRequest)
      .then(res =&gt; localStorage.setItem('user_data', JSON.stringify(res)))
      .catch(err =&gt; {
          console.error(err)
          login()
      })
  </code></pre>