-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathSignInRestController.java
More file actions
32 lines (26 loc) · 1.06 KB
/
SignInRestController.java
File metadata and controls
32 lines (26 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package edu.uark.registerapp.controllers;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import edu.uark.registerapp.controllers.enums.ViewNames;
import edu.uark.registerapp.models.api.ApiResponse;
import edu.uark.registerapp.commands.activeUsers.ActiveUserDeleteCommand;
@RestController
@RequestMapping(value = "/api")
public class SignInRestController extends BaseRestController {
@RequestMapping(value="/signOut", method = RequestMethod.DELETE)
public @ResponseBody ApiResponse removeActiveUser(
final HttpServletRequest request
) {
this.deleteUserCommand
.setSessionKey(request.getSession().getId())
.execute();
return (new ApiResponse())
.setRedirectUrl(ViewNames.SIGN_IN.getRoute());
}
@Autowired
private DeleteUserCommand deleteUserCommand;
}