How to use the @nestjs/jwt.JwtModule function in @nestjs/jwt

To help you get started, we’ve selected a few @nestjs/jwt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mpcast / mpcast-server / packages / core / dist / service / service.module.js View on Github external
user_service_1.UserService,
];
let ServiceModule = class ServiceModule {
    async onModuleInit() {
    }
};
ServiceModule = __decorate([
    common_1.Module({
        imports: [
            event_bus_module_1.EventBusModule,
            typeorm_1.TypeOrmModule.forRoot(config_helpers_1.getConfig().dbConnectionOptions),
            cache_module_1.CacheModule,
            passport_1.PassportModule.register({
                defaultStrategy: 'jwt',
            }),
            jwt_1.JwtModule.register({
                secretOrPrivateKey: APP_CONFIG.AUTH.jwtTokenSecret,
                signOptions: { expiresIn: APP_CONFIG.AUTH.expiresIn },
            }),
        ],
        providers: [
            ...exportedProviders,
            password_ciper_1.PasswordCiper,
        ],
        exports: exportedProviders,
    })
], ServiceModule);
exports.ServiceModule = ServiceModule;
//# sourceMappingURL=service.module.js.map
github mpcast / mpcast-server / packages / core / dist / api / api-internal-modules.js View on Github external
categories_controller_1.CategoriesController,
    comment_controller_1.CommentController,
    option_controller_1.OptionController,
    post_controller_1.PostController,
    user_controller_1.UserController,
    wechat_controller_1.WechatController,
];
let RestApiModule = class RestApiModule {
};
RestApiModule = __decorate([
    common_1.Module({
        imports: [
            passport_1.PassportModule.register({
                defaultStrategy: 'jwt',
            }),
            jwt_1.JwtModule.register({
                secretOrPrivateKey: APP_CONFIG.AUTH.jwtTokenSecret,
                signOptions: { expiresIn: APP_CONFIG.AUTH.expiresIn },
            }),
        ],
        controllers: [...controllers],
        providers: [service_module_1.ServiceModule],
    })
], RestApiModule);
exports.RestApiModule = RestApiModule;
//# sourceMappingURL=api-internal-modules.js.map
github vellengs / nestx-server / dist / auth / auth.module.js View on Github external
Object.defineProperty(exports, "__esModule", { value: true });
const common_1 = require("@nestjs/common");
const jwt_1 = require("@nestjs/jwt");
const passport_1 = require("@nestjs/passport");
const auth_controller_1 = require("./auth.controller");
const auth_service_1 = require("./auth.service");
const jwt_strategy_1 = require("./jwt.strategy");
const config_module_1 = require("./../config/config.module");
const config_service_1 = require("./../config/config.service");
let AuthModule = class AuthModule {
};
AuthModule = __decorate([
    common_1.Module({
        imports: [
            passport_1.PassportModule.register({ defaultStrategy: 'jwt' }),
            jwt_1.JwtModule.registerAsync({
                imports: [
                    config_module_1.ConfigModule,
                ],
                useFactory: (configService) => __awaiter(this, void 0, void 0, function* () {
                    return {
                        secretOrPrivateKey: configService.get('JWT_SECRET_KEY'),
                        signOptions: {
                            algorithm: configService.get('JWT_ALGORITHM'),
                            expiresIn: configService.get('JWT_EXPIRE_IN'),
                        },
                    };
                }),
                inject: [
                    config_service_1.ConfigService,
                ],
            }),

@nestjs/jwt

Nest - modern, fast, powerful node.js web framework (@jwt)

MIT
Latest version published 12 months ago

Package Health Score

83 / 100
Full package analysis

Similar packages