I'm building a single-page web application with integrated login/logout features. The back-end is powered by Grails 3 and Spring Security 3.0.3.
From Spring Securiy doc:
LoginController
has JSON-generating methodsajaxSuccess()
,ajaxDenied()
, andauthfail()
that generate JSON that the login Javascript code can use to appropriately display success or error messages.
Ajax requests are identified by default by the X-Requested-With
request header.
What about Ajax logout functionality though? As far as I could understand there's no built-in support to do that, so I'm looking for advice about the easiest way to achieve this.
At the moment, with the default Spring Security configuration, the logout works as expected (i.e. users are able to logout successfully), but of course what I get from the back-end is the login page's HTML.
Thanks in advance!