- Timestamp:
- 05/12/22 16:36:14 (2 years ago)
- Branches:
- master
- Children:
- cc4db18
- Parents:
- 7a983b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
resTools_backend/backend/Controllers/UsersController.cs
r7a983b0 rd76b7ee 2 2 3 3 using backend.DTOs; 4 using backend.Entities; 4 5 using backend.Helpers; 5 6 using backend.Models; … … 29 30 } 30 31 32 [HttpGet("authed")] 33 public async Task<AuthenticateResponse> IsAuthed() 34 { 35 int userId = 0; 36 try 37 { 38 userId = (int)this.HttpContext.Items["User"]; 39 }catch (Exception ex){ return null; } 40 User user = await _userService.GetById(userId); 41 return new AuthenticateResponse() { Email=user.Email, Id = user.Id}; 42 } 43 31 44 [HttpPost("register")] 32 45 public async Task<AuthenticateResponse> Register(CreateUserRequest req)
Note:
See TracChangeset
for help on using the changeset viewer.