title: msal token timeout using a React SPA
body: <p>I am using the msal library from npm (version 0.1.3) in a react application and can successfully redirect the user to login in and then acquire an access token.  The issue I'm having is that after an hour the token will timeout and my API will return a 401.</p>
  
  <p>I notice that when I refresh the SPA in the browser the msalRenewFrame iframe no longer appears in the html source even though I reinitialize the Msal.UserAgentApplication each time, however I'm not sure if that's the issue because the app times out even when I haven't refreshed.</p>
  
  <p>Below is the code that runs each time the app is loaded:</p>
  
  <pre><code>const authCallback = (errorDesc: string, token: string, error: string, tokenType: string) =&gt; { 
  
      console.log('authCallback (errorDesc, token, error, tokenType)', errorDesc, token, error, tokenType);
      if (error) {
          console.error(error);
      }    
  
      let scopes = [
          process.env.REACT_APP_AZURE_SCOPE_URL + '/read', 
          process.env.REACT_APP_AZURE_SCOPE_URL + '/write'
      ];
  
      msal.acquireTokenSilent(scopes)
          .then(scopeApiToken =&gt; {      
              apiToken = scopeApiToken;
              sessionStorage.setItem('apiToken', scopeApiToken);
              renderApp();                
          })
          .catch(e =&gt; {
              console.error(e);
          }); 
  };
  
  msal = new Msal.UserAgentApplication(
      process.env.REACT_APP_AZURE_B2C_WEB_CLIENT_APPID!, 
      process.env.REACT_APP_AZURE_B2C_SIGNIN_URL!,
      authCallback,
      {
          redirectUri: window.location.origin,
          logger: new Msal.Logger((level: Msal.LogLevel, message: string, containsPii: boolean) =&gt; {
              console.log(message);
          })
      }
  );
  
  let user = msal.getUser();
  let isCallback = msal.isCallback(window.location.hash);
  if (apiToken) {
      renderApp();
  } else if (user || isCallback) {
      ReactDOM.render(
          &lt;div&gt;
              &lt;Login 
                  content={&lt;Spinner size={SpinnerSize.medium} label="Signing in" /&gt;}
              /&gt;
          &lt;/div&gt;,
          root);    
  } else {
      ReactDOM.render(
          &lt;div&gt;
              &lt;Login 
                  redirectToRoot={true}
                  content={
                      &lt;PrimaryButton onClick={() =&gt; msal.loginRedirect(['openid'])}&gt;
                          Sign in with Microsoft
                      &lt;/PrimaryButton&gt;}
              /&gt;
          &lt;/div&gt;,
          root);
  } 
  </code></pre>