alkocats/http-ts

View on GitHub
src/controller/decorator/authentication/Authenticated.ts

Summary

Maintainability
A
0 mins
Test Coverage
F
20%
import { Controller } from '../../../controller/Controller';

export function Authenticated(): Function {
    return function (target: Controller<any, any, any, any>, propertyKey: string, descriptor: PropertyDescriptor) {
        if (!target.authenticatedActions) {
            target.authenticatedActions = new Set<string>();
        }
        target.authenticatedActions.add(propertyKey);
    };
}