I am using AWS Cognito to log in with Facebook in react. The problem is that after successful login my web app redirects to the callback URL defined in the App Client Setting.
For example, if I am at http://localhost:3000/tools/ and the redirect callback URL is http://localhost:3000/ the user will be redirected to the callback URL. I want the user to stay at my https://localhost:3000/tools/ page.
I have a login modal that can be accessed from any page so after login the user should stay on the same page.
How to make sure the user stays at the same page from the login request originated.