[ ] ๐ Documentation (updates to the documentation, readme or JSdoc annotations)
[ ] ๐ Bug fix (a non-breaking change that fixes an issue)
[x] ๐ Enhancement (improving an existing functionality like performance)
[x] โจ New feature (a non-breaking change that adds functionality)
[ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
[ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
Add functionality redirect user back to requested page after authentication
Added a redirect query parameter to auth middleware navigateTo when a guest visits authenicated page.
This will help users redirect back to previous page after sign in.
Currently when guest tries to access a protected page they are redirected to /login page and after login they are redirect to default callbackUrlunless they specify callbackUrl in the signIn function.
This feature will help automatically redirect a user back to the page they requested after login. For example, if they requested to access '/profile' and they are redirected to login page, after successful login, they will be redirected back to '/profile'. They can also override this by providing a callbackUrlin the signIn function as it is currently
๐ Linked issue
861
โ Type of change
๐ Description
Add functionality redirect user back to requested page after authentication Added a redirect query parameter to auth middleware navigateTo when a guest visits authenicated page. This will help users redirect back to previous page after sign in. Currently when guest tries to access a protected page they are redirected to
/login
page and after login they are redirect to defaultcallbackUrl
unless they specifycallbackUrl
in thesignIn
function.This feature will help automatically redirect a user back to the page they requested after login. For example, if they requested to access
'/profile'
and they are redirected to login page, after successful login, they will be redirected back to'/profile'
. They can also override this by providing acallbackUrl
in the signIn function as it is currently๐ Checklist