add password-based login endpoint
This commit is contained in:
parent
7959b64fe6
commit
656eec81d8
5 changed files with 40 additions and 21 deletions
|
@ -71,6 +71,13 @@ public static class HttpContextExtensions
|
|||
return token as Token;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Application GetApplicationOrThrow(this HttpContext context)
|
||||
{
|
||||
var token = context.GetToken();
|
||||
if (token is not { Account: null }) throw new ApiError.Forbidden("This endpoint requires a client token.");
|
||||
return token.Application;
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue