initial upload
This commit is contained in:
parent
a0aa9cc28e
commit
f857f43df4
553 changed files with 46169 additions and 13 deletions
55
src/Core/Insight.Domain/Models/Token.cs
Normal file
55
src/Core/Insight.Domain/Models/Token.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Insight.Domain.Models
|
||||
{
|
||||
public class TokenRequest
|
||||
{
|
||||
[JsonPropertyName("username"), EmailAddress, Required]
|
||||
public string Username { get; set; }
|
||||
|
||||
[JsonPropertyName("password"), DataType(DataType.Password), Required]
|
||||
public string Password { get; set; }
|
||||
|
||||
[JsonPropertyName("code"), DataType(DataType.Text)]
|
||||
public string? Code { get; set; }
|
||||
}
|
||||
|
||||
public class TokenResponse
|
||||
{
|
||||
[JsonPropertyName("access_token")]
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
[JsonPropertyName("expires_in")]
|
||||
public int ExpireInSeconds { get; set; }
|
||||
|
||||
[JsonPropertyName("refresh_token")]
|
||||
public string RefreshToken { get; set; }
|
||||
}
|
||||
|
||||
public class TokenRevokeRequest
|
||||
{
|
||||
[JsonPropertyName("token"), Required]
|
||||
public string Token { get; set; }
|
||||
|
||||
[JsonPropertyName("reason")]
|
||||
public string? Reason { get; set; }
|
||||
|
||||
public TokenRevokeRequest(string token, string? reason)
|
||||
{
|
||||
Token = token;
|
||||
Reason = reason;
|
||||
}
|
||||
}
|
||||
|
||||
public class TokenRefreshRequest
|
||||
{
|
||||
[JsonPropertyName("token"), Required]
|
||||
public string Token { get; set; }
|
||||
|
||||
public TokenRefreshRequest(string token)
|
||||
{
|
||||
Token = token;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue