react-aad icon indicating copy to clipboard operation
react-aad copied to clipboard

GetAccessToken add 2 pages to my history and break my navigation

Open NextStar31 opened this issue 5 years ago • 5 comments
trafficstars

Library versions

  • react-aad-msal: 2.3.2
  • msal: 1.2.1
  • react: 16.8.1
  • react-router: 3.0.5
  • @types/history: 3.2.2

Describe the bug At each "getAccessToken" call it's add 2 navigations to my history which totally breaks my navigation ( I need 3 clicks on "back" button to come back to the previous page).

I don't really understand what is happening and i didn't find any ideas or solutions on the web. So maybe you can help me. I tried to access the history list to see what is added but i failed.

To Reproduce Steps to reproduce the behavior: image

Desktop:

  • OS: windows 10
  • Browser : All (Chrome, FireFox, Opera with the lastest version)

NextStar31 avatar Jan 22 '20 16:01 NextStar31

Thanks for submitting this. This may be a MSAL issue, but I will try to do some testing to identify root cause. My suspicion is that the iframe which MSAL uses to acquire the token is adding entries to the history.

AndrewCraswell avatar Feb 03 '20 19:02 AndrewCraswell

@NextStar31, are you able to repro this with the sample app? I've tested and don't see additional entries added after calling the getAccessToken() method. Are you able to provide a repository that exhibits the behavior?

AndrewCraswell avatar Feb 04 '20 08:02 AndrewCraswell

HI ! Thank you for your response. I will try to repro with the sample app and see what i do differently. I will provide an small example with the problem

NextStar31 avatar Feb 11 '20 15:02 NextStar31

I just saw this issue filed on MSAL, could it be related to what you're seeing? https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/1310

AndrewCraswell avatar Mar 02 '20 21:03 AndrewCraswell

Hi, thx it is exactly my issue. I will post there to add to the post. Thank you

NextStar31 avatar Mar 11 '20 16:03 NextStar31