Expired token and old URL

Hi,
We are using React in our project and have some issues with logout.

If the user clear cache or close the browser tab and his token expire okta redirect him to the login page without redirect to (/logout) just (/login). And with the next successful login okta redirects to not to default (/) page where we set user account and token but to URL where this user has been logout last time, for example(/dashboard/users). And such an approach isn’t acceptable for us.

I have tried everything to change this behavior, but no success.

I will be very grateful for some help

Are you able to check the /authorize request to see what the redirect_uri is set to? I would be surprised to not see an error from Okta because every redirect uri has to be added to the application settings (“whitelist”). Is it possible that the react app is remembering which page the user was on and the redirecting the user to that page after they have been authenticated?