feat: add simple check for username and password

This commit is contained in:
Stevan Freeborn
2026-02-03 04:38:40 -06:00
parent 80b4e775d6
commit 1f84f47f31
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();
}
}