简体   繁体   中英

How to send custom state which has url or pathname from front end to backend for redirecting the page to current url after login in react with azuread

landing page need to be same as requested url after logging in . So thought of using custom state in which url or pathname should be stored . So how should i access the previous url , if i need to get it from frontend how can I get it without using props.history.push ? Please suggest some ideas

Please check if this can narrow down the issue:

  1. Go to browser settings>developer tools>console and check mark the preserve log option.

在此处输入图片说明

  1. Please check if navigateToLoginRequestUrl is set to true in userAgentApplication callback constructor. By default, msal tries to take you back to the loginStartPage after successful authentication. It can be disabled or set to false when not required. See : AzureAD/msal for js (github.com)
  2. Please check if you can use callback path like this as stated in junnas blog and store a local redirect url session cache

References:

  1. msal.js issures | GitHub
  2. SO reference
  3. Redirect to Previous URL after Login with Auth Guard | Jason Watmore's Blog

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM