UNPKG

nest-azure-ad-jwt-validator

Version:
21 lines 807 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AzureAdUser = void 0; class AzureAdUser { constructor(jwt) { var _a, _b, _c, _d; if (!jwt) { jwt = {}; } this.email = (_a = jwt.upn) !== null && _a !== void 0 ? _a : `ClientCredentialsToken|${(_b = jwt.appid) !== null && _b !== void 0 ? _b : ''}`; this.fullName = (_c = jwt.name) !== null && _c !== void 0 ? _c : `ClientCredentialsToken|${(_d = jwt.appid) !== null && _d !== void 0 ? _d : ''}`; this.id = jwt.oid; this.roles = jwt.roles; this.audience = jwt.aud; this.tenant = jwt.tid; this.subject = jwt.sub; this.appId = jwt.appid; } } exports.AzureAdUser = AzureAdUser; //# sourceMappingURL=azure-ad-user.js.map