source: phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/AuthContextController.java

Last change on this file was 775e15e, checked in by Marko <Marko@…>, 2 years ago

Added more controllers

  • Property mode set to 100644
File size: 687 bytes
Line 
1package finki.it.phoneluxbackend.controllers;
2
3import finki.it.phoneluxbackend.entities.User;
4import finki.it.phoneluxbackend.services.UserService;
5import lombok.AllArgsConstructor;
6import org.springframework.web.bind.annotation.GetMapping;
7import org.springframework.web.bind.annotation.PathVariable;
8import org.springframework.web.bind.annotation.RestController;
9
10@RestController
11@AllArgsConstructor
12public class AuthContextController {
13 private final UserService userService;
14
15 // return name, role, email
16 @GetMapping(path = "/token/{token}")
17 public User getUserFromToken(@PathVariable("token") String token){
18 return userService.getUserFromToken(token);
19 }
20}
Note: See TracBrowser for help on using the repository browser.