How to redirect to the URL originally tried to access in Static Web Apps?
matsunotsuma
0
Reputation points
I'm developing React Web Site with SWA.
And I use Entra ID for authentication.
My site can redirect to log in by staticwebapp.config.json like below,
"responseOverrides": {
"401": {
"statusCode": 302,
"redirect": "/.auth/login/aad"
}
}
but after logged in, redirect to route address of my site.
But I want to be redirected to the URL originally tried to access.
For example,
current situation:
https://mysite.com/authenticated/address
→ https://mysite.com/.auth/login/aad → https://mysite.com
desired outcome:
https://mysite.com/authenticated/address
→ https://mysite.com/.auth/login/aad → https://mysite.com/authenticated/address
How can I this?
Best Regard.
Sign in to answer