-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hilla doesn't redirect to a given URL when logout with Hilla's useAuth API #2235
Comments
This needs a change in |
Currently I am doing that like this TatuLund/hilla-v2-demo@ccc5570 |
#2237 was causing this, now it's fixed. |
Ah sorry, logout redirect... 😅 #2237 isn't related then. |
@mshabarov, it looks like there is no |
@Lodin it was merged into |
@mshabarov, @platosha, @Legioth, what would you expect on logout?
|
It's always a good practice to reload the page whenever the authentication state changes. When logging out, one of the main benefits is that you can ensure that no sensitive data remains referenced in JS variables. |
Description of the bug
Hilla doesn't redirect to a
logoutSuccessfulUrl
being set withVaadinWebSecurity::setLoginView(http, "/login", "/")
if the logout method uses Hilla's provideduseAuth::logout
API.It performs the logout successfully, but the page isn't redirected and the page content is visible.
If I logout from a Hilla view, it redirects me to login page, which also a bit unexpected, but better than keeping the content of the current page.
Here is how I configure my logout:
MainLayout.tsx:
auth.tsx
Browser sends POST "/logout" request to server and it's caught by
UidlRedirectStrategy
. Then it falls intosuper.sendRedirect(request, response, url);
and redirect doesn't happen for some reason.Expected behavior
Flow should redirect to "/" after logout.
Minimal reproducible example
Versions
The text was updated successfully, but these errors were encountered: