mirror of
https://github.com/bitwarden/server.git
synced 2025-02-18 02:11:22 +01:00
[PM-5437] Handle client_credentials clientId that is not a valid GUID (#3616)
* Return null if the clientId is not a valid Guid. * Linting
This commit is contained in:
parent
15eea77d66
commit
611a65e0a9
@ -90,7 +90,12 @@ public class ClientStore : IClientStore
|
|||||||
|
|
||||||
private async Task<Client> CreateApiKeyClientAsync(string clientId)
|
private async Task<Client> CreateApiKeyClientAsync(string clientId)
|
||||||
{
|
{
|
||||||
var apiKey = await _apiKeyRepository.GetDetailsByIdAsync(new Guid(clientId));
|
if (!Guid.TryParse(clientId, out var guid))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var apiKey = await _apiKeyRepository.GetDetailsByIdAsync(guid);
|
||||||
|
|
||||||
if (apiKey == null || apiKey.ExpireAt <= DateTime.Now)
|
if (apiKey == null || apiKey.ExpireAt <= DateTime.Now)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user