refactor(identity): change receiver of OauthUtils.ExpandScopes()
This commit is contained in:
parent
00a54f4f8b
commit
8bd118ea67
4 changed files with 13 additions and 14 deletions
|
@ -24,8 +24,8 @@ public class ClientAuthorizationMiddleware(
|
|||
var token = ctx.GetToken();
|
||||
if (token == null || token.Expires < clock.GetCurrentInstant())
|
||||
throw new ApiError.Unauthorized("This endpoint requires an authenticated user.");
|
||||
if (attribute.Scopes.Length > 0 && attribute.Scopes.Except(token.ExpandScopes()).Any())
|
||||
throw new ApiError.Forbidden("This endpoint requires ungranted scopes.", attribute.Scopes.Except(token.ExpandScopes()));
|
||||
if (attribute.Scopes.Length > 0 && attribute.Scopes.Except(token.Scopes.ExpandScopes()).Any())
|
||||
throw new ApiError.Forbidden("This endpoint requires ungranted scopes.", attribute.Scopes.Except(token.Scopes.ExpandScopes()));
|
||||
|
||||
await next(ctx);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue