add basic suppport for client_credentials oauth grant
This commit is contained in:
		
							parent
							
								
									049f4a56de
								
							
						
					
					
						commit
						8995213d26
					
				
					 20 changed files with 627 additions and 58 deletions
				
			
		| 
						 | 
				
			
			@ -63,7 +63,7 @@ public static class HttpContextExtensions
 | 
			
		|||
    public static void SetToken(this HttpContext ctx, Token token) => ctx.Items.Add(Key, token);
 | 
			
		||||
    public static Account? GetAccount(this HttpContext ctx) => ctx.GetToken()?.Account;
 | 
			
		||||
    public static Account GetAccountOrThrow(this HttpContext ctx) =>
 | 
			
		||||
        ctx.GetAccount() ?? throw new FoxchatError.AuthenticationError("No account in HttpContext");
 | 
			
		||||
        ctx.GetAccount() ?? throw new ApiError.AuthenticationError("No account in HttpContext");
 | 
			
		||||
 | 
			
		||||
    public static Token? GetToken(this HttpContext ctx)
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue