Use Unauthorized instead of Forbid on Website & Api

This commit is contained in:
Slendy 2023-03-29 21:44:16 -05:00
parent b0858448c8
commit a603cdb002
No known key found for this signature in database
GPG key ID: 7288D68361B91428
2 changed files with 4 additions and 4 deletions
ProjectLighthouse.Servers.API/Controllers

View file

@ -105,7 +105,7 @@ public class UserEndpoints : ApiEndpointController
string authToken = authHeader[(authHeader.IndexOf(' ') + 1)..];
ApiKeyEntity? apiKey = await this.database.APIKeys.FirstOrDefaultAsync(k => k.Key == authToken);
if (apiKey == null) return this.Forbid();
if (apiKey == null) return this.Unauthorized();
if (!string.IsNullOrWhiteSpace(username))
{