Started implementing api key expiration
This commit is contained in:
@@ -35,6 +35,10 @@
|
||||
<FieldLabel for="keyDescription">Description</FieldLabel>
|
||||
<TextareaInputField @bind-Value="Request.Description" id="keyDescription" placeholder="What this key is for"/>
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel for="keyValidUntil">Valid until</FieldLabel>
|
||||
<DateTimeInputField @bind-Value="Request.ValidUntil" id="keyValidUntil" />
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel>Permissions</FieldLabel>
|
||||
<FieldContent>
|
||||
@@ -60,13 +64,15 @@
|
||||
{
|
||||
Request = new()
|
||||
{
|
||||
Permissions = []
|
||||
Permissions = [],
|
||||
ValidUntil = DateTimeOffset.UtcNow
|
||||
};
|
||||
}
|
||||
|
||||
private async Task<bool> OnSubmitAsync(EditContext editContext, ValidationMessageStore validationMessageStore)
|
||||
{
|
||||
Request.Permissions = Permissions.ToArray();
|
||||
Request.ValidUntil = Request.ValidUntil.ToUniversalTime();
|
||||
|
||||
var response = await HttpClient.PostAsJsonAsync(
|
||||
"/api/admin/apiKeys",
|
||||
|
||||
Reference in New Issue
Block a user