source: src/main/java/com/example/eatys_app/controller/LogoutController.java@ b3f2adb

Last change on this file since b3f2adb was b3f2adb, checked in by Aleksandar Siljanoski <acewow3@…>, 14 months ago

Adding project to repo

  • Property mode set to 100644
File size: 492 bytes
Line 
1package com.example.eatys_app.controller;
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:/login";
16 }
17}
Note: See TracBrowser for help on using the repository browser.