public abstract Task <(bool, JsonResult)> AuthorizeAsync(HttpContext httpContext, TokenValidResult validResult);
public override Task <(bool, JsonResult)> AuthorizeAsync(HttpContext httpContext, TokenValidResult validResult) { if (!validResult.HasToken) { return(Task.FromResult <(bool, JsonResult)>((false, Provider.CreateNotLoginResponse(httpContext)))); } if (validResult.HasExpire) { return(Task.FromResult <(bool, JsonResult)>((false, Provider.CreateTokenExpireResponse(httpContext)))); } else if (!validResult.Success || httpContext.User == null) { return(Task.FromResult <(bool, JsonResult)>((false, Provider.CreateTokenErrorResponse(httpContext)))); } return(Task.FromResult <(bool, JsonResult)>((true, null))); }