@webundsoehne/nestjs-auth0-guard
Version:
NestJS Auth0 Guard
36 lines • 1.74 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var Auth0Module_1;
Object.defineProperty(exports, "__esModule", { value: true });
const common_1 = require("@nestjs/common");
const passport_1 = require("@nestjs/passport");
const auth0_jwt_strategy_1 = require("./strategy/auth0-jwt.strategy");
const auth0_service_1 = require("./auth0.service");
let Auth0Module = Auth0Module_1 = class Auth0Module {
static register({ options, ...inject }) {
return {
module: Auth0Module_1,
providers: [
{
provide: auth0_jwt_strategy_1.Auth0JwtStrategy,
useFactory: (auth0Service) => new auth0_jwt_strategy_1.Auth0JwtStrategy(options, auth0Service, inject),
inject: [auth0_service_1.Auth0Service]
}
]
};
}
};
Auth0Module = Auth0Module_1 = __decorate([
common_1.Module({
imports: [passport_1.PassportModule],
providers: [auth0_jwt_strategy_1.Auth0JwtStrategy, auth0_service_1.Auth0Service],
exports: [auth0_jwt_strategy_1.Auth0JwtStrategy]
})
], Auth0Module);
exports.Auth0Module = Auth0Module;
//# sourceMappingURL=auth0.module.js.map