fr.smallcrew.security.web.LogoutController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smallcrew-security Show documentation
Show all versions of smallcrew-security Show documentation
Foundation of all smallcrew's projects needing authenticated users and role management
The newest version!
package fr.smallcrew.security.web;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/logout")
public class LogoutController {
@RequestMapping(method = RequestMethod.GET)
public void logout() {
SecurityContextHolder.getContext().setAuthentication(null);
SecurityContextHolder.clearContext();
}
}