microsoft-graph-toolkit icon indicating copy to clipboard operation
microsoft-graph-toolkit copied to clipboard

[BUG] Login control fails when refreshing the token after more than an hour of inactivity

Open mpaliath opened this issue 2 weeks ago • 1 comments

Describe the bug When the access token has expired, if the user comes back to the app, the Login component from @microsoft/mgt-react shows an error text TypeError: Cannot read properties of null (reading 'personImage') instead of the actual control.

To Reproduce Steps to reproduce the behavior:

  1. Use the login control to sign in using a personal Microsoft account.
  2. Note the login control now shows the signed in user.
  3. Do nothing in the app and wait for > 1 hour
  4. Refresh the page.
  5. See error.

Expected behavior The login control should show the signed in user

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser [e.g. edge, chrome, safari] Edge
  • Framework [e.g. react, vue, none] React
  • Context [e.g. Microsoft Teams, SharePoint, Office Add-ins, Web] Web
  • Version [e.g. 0.1] 4.2.2
  • Provider [e.g. Msal2Provider] (bonus if you share the provider config) Msal2Provider

Providers.globalProvider = new Msal2Provider({ clientId: '5cf21436-2a20-447b-b222-77a1326409bb', scopes: [ 'profile', 'openid', 'User.Read' ],
});

Additional context There was no problem with the v3 version I had been using. Problem started after the upgrade.

mpaliath avatar Jun 19 '24 20:06 mpaliath