@irfanakbari/nova-auth
Version:
Authentication and authorization module for NestJS
10 lines • 397 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserId = void 0;
const common_1 = require("@nestjs/common");
exports.UserId = (0, common_1.createParamDecorator)((data, ctx) => {
var _a;
const req = ctx.switchToHttp().getRequest();
return (_a = req.user) === null || _a === void 0 ? void 0 : _a.sub;
});
//# sourceMappingURL=user-id.decorator.js.map