Refactor response models for Application and User

This commit is contained in:
Sipke Schoorstra 2023-03-27 11:36:11 +02:00
parent 97b8d2ae7d
commit aabdce5ff4
4 changed files with 12 additions and 6 deletions

View file

@ -76,8 +76,10 @@ internal class Create : Endpoint<Request, Response>
clientId,
clientSecret,
apiKey,
hashedApiKey,
hashedClientSecret);
hashedApiKey.EncodeSecret(),
hashedApiKey.EncodeSalt(),
hashedClientSecret.EncodeSecret(),
hashedClientSecret.EncodeSalt());
await SendOkAsync(response, cancellationToken);
}

View file

@ -15,6 +15,8 @@ internal record Response(
string ClientId,
string ClientSecret,
string ApiKey,
HashedSecret HashedApiKey,
HashedSecret HashedClientSecret
string HashedApiKey,
string HashedApiKeySalt,
string HashedClientSecret,
string HashedClientSecretSalt
);

View file

@ -62,7 +62,8 @@ internal class Create : ElsaEndpoint<Request, Response>
user.Name,
password,
user.Roles,
hashedPassword);
hashedPassword.EncodeSecret(),
hashedPassword.EncodeSalt());
await SendOkAsync(response, cancellationToken);
}

View file

@ -14,5 +14,6 @@ internal record Response(
string Name,
string Password,
ICollection<string> Roles,
HashedSecret HashedPassword
string HashedPassword,
string HashedPasswordSalt
);