vaadin / bakery-app-starter-fw8-spring

Internal repository for Bakery App Starter for FW8 and Spring
Other
0 stars 2 forks source link

Logout is done by invalidating session, as a result you can't attach logoutHandler in spring. #427

Open rogozinds opened 7 years ago

rogozinds commented 7 years ago

The logout is done like this

getUI.getSession().invalidate
navigate to same view (that will redirect you to login page).

So it's technically not a "correct" logout, it's more like a hard reset. So if you want to add some successful logout logic, as the app does not distinguish "correct" logout from any other logout.

Is the proper way of logging out this one:

HttpServletRequest req = ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
            req.logout();