node-nlp
Version:
Library for NLU (Natural Language Understanding) done in Node.js
22 lines • 698 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Represents a claims-based identity.
*/
class ClaimsIdentity {
constructor(claims, isAuthenticated) {
this.claims = claims;
this.isAuthenticated = isAuthenticated;
}
/**
* Returns a claim value (if its present)
* @param {string} claimType The claim type to look for
* @returns {string|null} The claim value or null if not found
*/
getClaimValue(claimType) {
const claim = this.claims.find((c) => c.type === claimType);
return claim ? claim.value : null;
}
}
exports.ClaimsIdentity = ClaimsIdentity;
//# sourceMappingURL=claimsIdentity.js.map
;