UNPKG

lbx-jwt

Version:

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

74 lines 2.91 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AuthenticationResponse = void 0; const tslib_1 = require("tslib"); /* eslint-disable jsdoc/require-jsdoc */ const repository_1 = require("@loopback/repository"); const authentication_extensions_outputs_model_1 = require("./authentication-extensions-outputs.model"); const authenticator_assertion_response_model_1 = require("./authenticator-assertion-response.model"); const webauthn_utilities_1 = require("../../../encapsulation/webauthn.utilities"); /** * Response from the frontend when authentication was successful. */ let AuthenticationResponse = class AuthenticationResponse { }; exports.AuthenticationResponse = AuthenticationResponse; tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: true }), tslib_1.__metadata("design:type", String) ], AuthenticationResponse.prototype, "id", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: true }), tslib_1.__metadata("design:type", String) ], AuthenticationResponse.prototype, "rawId", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: authenticator_assertion_response_model_1.AuthenticatorAssertionResponse, required: true }), tslib_1.__metadata("design:type", authenticator_assertion_response_model_1.AuthenticatorAssertionResponse) ], AuthenticationResponse.prototype, "response", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: false, jsonSchema: { enum: Object.values(webauthn_utilities_1.authenticatorAttachmentValues) } }), tslib_1.__metadata("design:type", String) ], AuthenticationResponse.prototype, "authenticatorAttachment", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: authentication_extensions_outputs_model_1.AuthenticationExtensionsOutputs, required: true }), tslib_1.__metadata("design:type", authentication_extensions_outputs_model_1.AuthenticationExtensionsOutputs) ], AuthenticationResponse.prototype, "clientExtensionResults", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: true, jsonSchema: { enum: webauthn_utilities_1.publicKeyCredentialTypeValues } }), tslib_1.__metadata("design:type", String) ], AuthenticationResponse.prototype, "type", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: true }), tslib_1.__metadata("design:type", String) ], AuthenticationResponse.prototype, "userId", void 0); exports.AuthenticationResponse = AuthenticationResponse = tslib_1.__decorate([ (0, repository_1.model)() ], AuthenticationResponse); //# sourceMappingURL=authentication-response.model.js.map