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 | |
---|
1 | package finki.it.phoneluxbackend.controllers;
|
---|
2 |
|
---|
3 | import finki.it.phoneluxbackend.entities.User;
|
---|
4 | import finki.it.phoneluxbackend.services.UserService;
|
---|
5 | import lombok.AllArgsConstructor;
|
---|
6 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
7 | import org.springframework.web.bind.annotation.PathVariable;
|
---|
8 | import org.springframework.web.bind.annotation.RestController;
|
---|
9 |
|
---|
10 | @RestController
|
---|
11 | @AllArgsConstructor
|
---|
12 | public 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.