UNPKG

@zigatech/keycloak-auth

Version:

Keycloak authorization library for NestJS. Works out of the box.

10 lines (9 loc) 332 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UserID = void 0; const common_1 = require("@nestjs/common"); exports.UserID = (0, common_1.createParamDecorator)((_, ctx) => { const req = ctx.switchToHttp().getRequest(); const principal = req.principal; return principal.getId(); });