feat: add simple check for username and password
This commit is contained in:
@@ -11,8 +11,30 @@ internal static class Endpoint
|
||||
|
||||
private static async Task<IResult> HandleAsync([FromBody] LoginRequest loginRequest)
|
||||
{
|
||||
Console.WriteLine(loginRequest.Username);
|
||||
Console.WriteLine(loginRequest.Password);
|
||||
const string ADMIN_USERNAME = "Stevan";
|
||||
const string ADMIN_PASSWORD = "@Password1";
|
||||
|
||||
// TODO: Implement actual auth flow
|
||||
// 1. We want to make sure that
|
||||
// the user exists
|
||||
// 2. We want to make sure that
|
||||
// tha the password is correct
|
||||
// 3. We want to issue an access token
|
||||
// with a refresh token
|
||||
// 4. We want to store the refresh
|
||||
// token
|
||||
// 5. We want to set the refresh
|
||||
// token in a cookie
|
||||
|
||||
// TODO: Things we need
|
||||
// 1. We need a user model
|
||||
// 2. We need a refresh token model
|
||||
|
||||
if (loginRequest.Username is not ADMIN_USERNAME || loginRequest.Password is not ADMIN_PASSWORD)
|
||||
{
|
||||
return Results.Unauthorized();
|
||||
}
|
||||
|
||||
return Results.Ok();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user