1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-20 02:48:03 -05:00

Update src/Api/KeyManagement/Controllers/UsersController.cs

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
This commit is contained in:
Bernd Schoolmann 2025-06-12 15:30:55 +02:00 committed by GitHub
parent a417aa72e8
commit 038b4edebe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,10 +23,9 @@ public class UsersController(
}
[HttpGet("{id}/keys")]
public async Task<PublicKeysResponseModel> GetAccountKeysAsync(string id)
public async Task<PublicKeysResponseModel> GetAccountKeysAsync([FromRoute]Guid id)
{
var guidId = new Guid(id);
var user = await _userRepository.GetByIdAsync(guidId) ?? throw new NotFoundException();
var user = await _userRepository.GetByIdAsync(id) ?? throw new NotFoundException();
var accountKeys = await _userAccountKeysQuery.Run(user) ?? throw new NotFoundException("User account keys not found.");
return new PublicKeysResponseModel(accountKeys);
}