Skip to content

Commit 7686acd

Browse files
committed
deleted id from request url
1 parent 2debe17 commit 7686acd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

TableBooking.Api/Controllers/UserController.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,16 @@ public async Task<IActionResult> Logout()
4747

4848
[HttpGet]
4949
[Authorize]
50-
[Route("{id:guid}")]
51-
public async Task<AppUserDto> GetUserInfo(Guid id)
50+
public async Task<AppUserDto> GetUserInfo()
5251
{
53-
return await _userService.GetUserInfo(id, CancellationToken.None);
52+
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
53+
54+
if (userId == null)
55+
{
56+
throw new UnauthorizedAccessException("User is not authenticated.");
57+
}
58+
59+
return await _userService.GetUserInfo(Guid.Parse(userId), CancellationToken.None);
5460
}
5561
}
5662
}

0 commit comments

Comments
 (0)