Skip to content

Commit 8cc84b0

Browse files
committed
Fixed inconsistent roles in authorizationChecker - #308
1 parent ac504ae commit 8cc84b0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/metadata/ActionMetadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export class ActionMetadata {
207207
this.headers = this.buildHeaders(responseHandlers);
208208

209209
this.isAuthorizedUsed = this.controllerMetadata.isAuthorizedUsed || !!authorizedHandler;
210-
this.authorizedRoles = (this.controllerMetadata.authorizedRoles || []).concat(authorizedHandler && authorizedHandler.value ? authorizedHandler.value : []);
210+
this.authorizedRoles = (this.controllerMetadata.authorizedRoles || []).concat((authorizedHandler && authorizedHandler.value) || []);
211211
}
212212

213213
// -------------------------------------------------------------------------

src/metadata/ControllerMetadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class ControllerMetadata {
8686
build(responseHandlers: ResponseHandlerMetadata[]) {
8787
const authorizedHandler = responseHandlers.find(handler => handler.type === "authorized" && !handler.method);
8888
this.isAuthorizedUsed = !!authorizedHandler;
89-
this.authorizedRoles = authorizedHandler ? authorizedHandler.value : [];
89+
this.authorizedRoles = [].concat((authorizedHandler && authorizedHandler.value) || []);
9090
}
9191

9292
}

0 commit comments

Comments
 (0)