I'm using grails spring security and want to redirect user to some url just after logout. What I've discovered so far is that there is a special property for that called 'logout.afterLogoutUrl'
and that grails.plugin.springsecurity.logout.postOnly
should be set to false. So in my Config.groovy I have:
grails.plugin.springsecurity.logout.postOnly = false
logout.afterLogoutUrl = "/"
my logout button looks like:
<sec:ifLoggedIn>
<g:remoteLink class="logout buttons" controller="logout"><g:message code="btn.logout"
default="Loading…"/></g:remoteLink>
</sec:ifLoggedIn>
When I click on logout button the following sequence of requests appears:
- /logout/index
- /j_spring_security_logout
- /
- /login/authAjax
and from the last one I get 'Status Code:401 Unauthorized' but user still sees the page from where I clicked logout button. Does anyone know how to handle this situation? Thank you very much!