feat: add simple check for username and password

This commit is contained in:
Stevan Freeborn
2026-02-01 06:12:49 -06:00
parent a1d22b0ec2
commit 093ee2c357
2 changed files with 135 additions and 14 deletions
+24 -2
View File
@@ -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();
}
}