UNPKG

@sync-in/server

Version:

The secure, open-source platform for file storage, sharing, collaboration, and sync

87 lines (86 loc) 4.05 kB
/* * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com> * This file is part of Sync-in | The open source file sync and share solution * See the LICENSE file for licensing details */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "AuthModule", { enumerable: true, get: function() { return AuthModule; } }); const _common = require("@nestjs/common"); const _core = require("@nestjs/core"); const _jwt = require("@nestjs/jwt"); const _passport = require("@nestjs/passport"); const _usersmodule = require("../applications/users/users.module"); const _configenvironment = require("../configuration/config.environment"); const _authcontroller = require("./auth.controller"); const _authanonymousguard = require("./guards/auth-anonymous.guard"); const _authanonymousstrategy = require("./guards/auth-anonymous.strategy"); const _authbasicguard = require("./guards/auth-basic.guard"); const _authbasicstrategy = require("./guards/auth-basic.strategy"); const _authlocalguard = require("./guards/auth-local.guard"); const _authlocalstrategy = require("./guards/auth-local.strategy"); const _authtokenaccessguard = require("./guards/auth-token-access.guard"); const _authtokenaccessstrategy = require("./guards/auth-token-access.strategy"); const _authtokenrefreshguard = require("./guards/auth-token-refresh.guard"); const _authtokenrefreshstrategy = require("./guards/auth-token-refresh.strategy"); const _authmethod = require("./models/auth-method"); const _authmanagerservice = require("./services/auth-manager.service"); const _authmethoddatabaseservice = require("./services/auth-methods/auth-method-database.service"); const _authmethodldapservice = require("./services/auth-methods/auth-method-ldap.service"); const _authmethodtwofaservice = require("./services/auth-methods/auth-method-two-fa.service"); function _ts_decorate(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; } let AuthModule = class AuthModule { }; AuthModule = _ts_decorate([ (0, _common.Global)(), (0, _common.Module)({ imports: [ _jwt.JwtModule.register({ global: true }), _usersmodule.UsersModule, _passport.PassportModule ], controllers: [ _authcontroller.AuthController ], providers: [ { provide: _core.APP_GUARD, useClass: _authtokenaccessguard.AuthTokenAccessGuard }, _authtokenrefreshguard.AuthTokenRefreshGuard, _authlocalguard.AuthLocalGuard, _authbasicguard.AuthBasicGuard, _authanonymousguard.AuthAnonymousGuard, _authlocalstrategy.AuthLocalStrategy, _authtokenaccessstrategy.AuthTokenAccessStrategy, _authtokenrefreshstrategy.AuthTokenRefreshStrategy, _authbasicstrategy.AuthBasicStrategy, _authanonymousstrategy.AuthAnonymousStrategy, _authmanagerservice.AuthManager, _authmethodtwofaservice.AuthMethod2FA, { provide: _authmethod.AuthMethod, useClass: _configenvironment.configuration.auth.method === 'ldap' ? _authmethodldapservice.AuthMethodLdapService : _authmethoddatabaseservice.AuthMethodDatabase } ], exports: [ _authmanagerservice.AuthManager, _authmethod.AuthMethod, _authmethodtwofaservice.AuthMethod2FA ] }) ], AuthModule); //# sourceMappingURL=auth.module.js.map