source: src/main/java/com/example/villadihovo/web/controller/ControllersForHome/LogoutController.java

Last change on this file was f7c05a1, checked in by Elena Shulevska <elena.shulevska@…>, 15 months ago

initial commit of the source code on origin

  • Property mode set to 100644
File size: 520 bytes
Line 
1package com.example.villadihovo.web.controller.ControllersForHome;
2
3import jakarta.servlet.http.HttpServletRequest;
4import org.springframework.stereotype.Controller;
5import org.springframework.web.bind.annotation.GetMapping;
6import org.springframework.web.bind.annotation.RequestMapping;
7
8@Controller
9@RequestMapping("/logout")
10public class LogoutController {
11
12 @GetMapping
13 public String logout(HttpServletRequest request){
14 request.getSession().invalidate();
15 return "redirect:/api/login";
16 }
17}
Note: See TracBrowser for help on using the repository browser.