0

Is it possible to allow query parameters in redirect uri's without using a state parameter?

I have a react application that can only be used after being logged in, some pages modify the URL to contain IDs of particular items the user wants to view later, these URLs can be bookmarked. The problem Im having is that when opening bookmarked URL's the query parameters do not get included.

For example when opening the following URL - https://URL/APP/ui/items?ids=%5B%224%22%5D only https://URL/APP/ui/items would show, the query parameters with the ID's would be missing.

In my react code, I'm using react-router-dom hook useSearchParams() to set the ids dynamically, in Azure I have my redirect uri to accept anything with the use of a wild card as seen below

{ "url": "https://URL/APP/ui/*", "type": "Spa"},

Is there anything in Azure or React that I can set/configure to make sure these query parameters don't disappear?

Any help would be appreciated.

wwwwwwww
  • 15
  • 1
  • 4
  • Have you identified where in your code those query parameters are being stripped? – sneakycrow Dec 27 '22 at 20:26
  • @sneakycrow Yes - I set the ids from the URL to some state, here's some of the code `const [searchParams, setSearchParams] = useSearchParams(); const [selectionModel, setSelectionModel] = useState(JSON.parse(searchParams.get("ids")));` – wwwwwwww Dec 27 '22 at 20:32

0 Answers0