Depending on where you place the @Authorized decorator on your controller, the value of the role passed in is returned as either a string or an array which is a bit inconsistent
Take this as an example
@JsonController('/string')
@Authorized('Role')
export class StringController {
@Get()
public httpGet () {
return 'Hello world';
}
}
@JsonController('/array')
export class ArrayController {
@Get()
@Authorized('Role')
public httpGet () {{
return 'Hello world';
}
}
function authorizationChecker (action, role) {
console.log(role);
}
The StringController will output Role inside the authorizationChecker whilst the ArrayController will return ['Role']. Shouldn't the value of the role remain the same no matter where the decorator is placed?
This is using routing-controllers@0.7.5, express@4.16.2 and node@8.2.1