UNPKG

lbx-jwt

Version:

Provides JWT authentication for loopback applications. Includes storing roles inside tokens and handling refreshing. Built-in reuse detection.

60 lines 1.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Credentials = void 0; const tslib_1 = require("tslib"); const repository_1 = require("@loopback/repository"); /** * The credentials of an user. * They are stored separately so its less likely there are sent to the frontend by accident. */ let Credentials = class Credentials extends repository_1.Entity { constructor(data) { super(data); } }; exports.Credentials = Credentials; tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: true, defaultFn: 'uuidv4', id: true }), tslib_1.__metadata("design:type", String) ], Credentials.prototype, "id", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: true, jsonSchema: { minLength: 12 } }), tslib_1.__metadata("design:type", String) ], Credentials.prototype, "password", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: false }), tslib_1.__metadata("design:type", String) ], Credentials.prototype, "twoFactorSecret", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: false }), tslib_1.__metadata("design:type", String) ], Credentials.prototype, "twoFactorAuthUrl", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: true }), tslib_1.__metadata("design:type", String) ], Credentials.prototype, "baseUserId", void 0); exports.Credentials = Credentials = tslib_1.__decorate([ (0, repository_1.model)(), tslib_1.__metadata("design:paramtypes", [Object]) ], Credentials); //# sourceMappingURL=credentials.model.js.map