@ackplus/nest-auth 1.1.47 → 1.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/admin-console/static/index.html +1 -1
- package/dist/lib/admin-console/static/nest-auth.json +1 -1
- package/dist/lib/auth/guards/auth.guard.d.ts.map +1 -1
- package/dist/lib/auth/guards/auth.guard.js +50 -28
- package/dist/lib/auth/guards/auth.guard.js.map +1 -1
- package/dist/lib/core/decorators/role.decorator.d.ts +1 -1
- package/dist/lib/core/decorators/role.decorator.d.ts.map +1 -1
- package/dist/lib/core/decorators/role.decorator.js +9 -9
- package/dist/lib/core/decorators/role.decorator.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ export * from './lib/user';
|
|
|
6
6
|
export * from './lib/role';
|
|
7
7
|
export * from './lib/tenant';
|
|
8
8
|
export * from './lib/core';
|
|
9
|
-
export * from './lib/request-context';
|
|
10
9
|
export type { IAuthModuleOptions, IAuthModuleAsyncOptions, IAuthModuleOptionsFactory, IDefaultTenantOptions, IAdminConsoleOptions, } from './lib/core/interfaces/auth-module-options.interface';
|
|
11
10
|
export { AuthConfigService } from './lib/core/services/auth-config.service';
|
|
12
11
|
export { DebugLoggerService, DebugLogLevel } from './lib/core/services/debug-logger.service';
|
|
13
12
|
export type { DebugLogOptions } from './lib/core/services/debug-logger.service';
|
|
14
13
|
export { NestAuthAdminUser } from './lib/admin-console/entities/admin-user.entity';
|
|
14
|
+
export { NestAuthMFAMethodEnum, NestAuthOTPTypeEnum } from '@ackplus/nest-auth-contracts';
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AAEvC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AAEvC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAG3B,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qDAAqD,CAAC;AAG7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAC7F,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAGhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAGnF,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.NestAuthAdminUser = exports.DebugLogLevel = exports.DebugLoggerService = exports.AuthConfigService = void 0;
|
|
17
|
+
exports.NestAuthOTPTypeEnum = exports.NestAuthMFAMethodEnum = exports.NestAuthAdminUser = exports.DebugLogLevel = exports.DebugLoggerService = exports.AuthConfigService = void 0;
|
|
18
18
|
__exportStar(require("./lib/nest-auth.module"), exports);
|
|
19
19
|
__exportStar(require("./lib/auth.constants"), exports);
|
|
20
20
|
__exportStar(require("./lib/auth"), exports);
|
|
@@ -23,7 +23,6 @@ __exportStar(require("./lib/user"), exports);
|
|
|
23
23
|
__exportStar(require("./lib/role"), exports);
|
|
24
24
|
__exportStar(require("./lib/tenant"), exports);
|
|
25
25
|
__exportStar(require("./lib/core"), exports);
|
|
26
|
-
__exportStar(require("./lib/request-context"), exports);
|
|
27
26
|
var auth_config_service_1 = require("./lib/core/services/auth-config.service");
|
|
28
27
|
Object.defineProperty(exports, "AuthConfigService", { enumerable: true, get: function () { return auth_config_service_1.AuthConfigService; } });
|
|
29
28
|
var debug_logger_service_1 = require("./lib/core/services/debug-logger.service");
|
|
@@ -31,4 +30,7 @@ Object.defineProperty(exports, "DebugLoggerService", { enumerable: true, get: fu
|
|
|
31
30
|
Object.defineProperty(exports, "DebugLogLevel", { enumerable: true, get: function () { return debug_logger_service_1.DebugLogLevel; } });
|
|
32
31
|
var admin_user_entity_1 = require("./lib/admin-console/entities/admin-user.entity");
|
|
33
32
|
Object.defineProperty(exports, "NestAuthAdminUser", { enumerable: true, get: function () { return admin_user_entity_1.NestAuthAdminUser; } });
|
|
33
|
+
var nest_auth_contracts_1 = require("@ackplus/nest-auth-contracts");
|
|
34
|
+
Object.defineProperty(exports, "NestAuthMFAMethodEnum", { enumerable: true, get: function () { return nest_auth_contracts_1.NestAuthMFAMethodEnum; } });
|
|
35
|
+
Object.defineProperty(exports, "NestAuthOTPTypeEnum", { enumerable: true, get: function () { return nest_auth_contracts_1.NestAuthOTPTypeEnum; } });
|
|
34
36
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAuC;AAEvC,uDAAqC;AAGrC,6CAA2B;AAC3B,gDAA8B;AAC9B,6CAA2B;AAC3B,6CAA2B;AAC3B,+CAA6B;AAC7B,6CAA2B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAuC;AAEvC,uDAAqC;AAGrC,6CAA2B;AAC3B,gDAA8B;AAC9B,6CAA2B;AAC3B,6CAA2B;AAC3B,+CAA6B;AAC7B,6CAA2B;AAY3B,+EAA4E;AAAnE,wHAAA,iBAAiB,OAAA;AAG1B,iFAA6F;AAApF,0HAAA,kBAAkB,OAAA;AAAE,qHAAA,aAAa,OAAA;AAI1C,oFAAmF;AAA1E,sHAAA,iBAAiB,OAAA;AAG1B,oEAA0F;AAAjF,4HAAA,qBAAqB,OAAA;AAAE,0HAAA,mBAAmB,OAAA"}
|
|
@@ -5207,7 +5207,7 @@ export class OnboardingService {
|
|
|
5207
5207
|
- Header mode (default): Returns new tokens in response body
|
|
5208
5208
|
- Cookie mode: Sets new tokens in HTTP-only cookies and returns success message`,operationId:"AuthController_refreshToken",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthRefreshTokenRequestDto"}}}},responses:{200:{description:"Header mode: Returns message + tokens in body",content:{"application/json":{schema:{$ref:"#/components/schemas/AuthWithTokensResponseDto"}}}}},summary:"Refresh Token",tags:["Auth"]}},"/auth/mfa/challenge":{post:{operationId:"MfaController_challenge",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthSendMfaCodeRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthMfaCodeSentResponseDto"}}}}},summary:"Send MFA code for setup/verification",tags:["Mfa"]}},"/auth/mfa/verify":{post:{description:`Verify multi-factor authentication. Response format depends on accessTokenType configuration:
|
|
5209
5209
|
- Header mode (default): Returns tokens in response body
|
|
5210
|
-
- Cookie mode: Sets tokens in HTTP-only cookies and returns success message`,operationId:"AuthController_verify2fa",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthVerify2faRequestDto"}}}},responses:{200:{description:"Header mode: Returns message + tokens in body",content:{"application/json":{schema:{$ref:"#/components/schemas/Verify2faWithTokensResponseDto"}}}}},summary:"Verify MFA",tags:["Auth"]}},"/auth/logout":{post:{operationId:"AuthController_logout",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthLogoutResponseDto"}}}}},summary:"Logout",tags:["Auth"]}},"/auth/logout-all":{post:{operationId:"AuthController_logoutAll",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthLogoutAllResponseDto"}}}}},summary:"Logout All",tags:["Auth"]}},"/auth/change-password":{post:{operationId:"AuthController_changePassword",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthChangePasswordRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/AuthWithTokensResponseDto"}}}}},summary:"Change Password",tags:["Auth"]}},"/auth/forgot-password":{post:{operationId:"AuthController_forgotPassword",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthForgotPasswordRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthPasswordResetLinkSentResponseDto"}}}}},summary:"Forgot password",tags:["Auth"]}},"/auth/verify-forgot-password-otp":{post:{operationId:"AuthController_verifyForgotPasswordOtp",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthVerifyForgotPasswordOtpRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/VerifyOtpResponseDto"}}}}},summary:"Verify Forgot Password OTP and get reset token",tags:["Auth"]}},"/auth/reset-password":{post:{operationId:"AuthController_resetPassword",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthResetPasswordWithTokenRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthPasswordResetResponseDto"}}}}},summary:"Reset password",tags:["Auth"]}},"/auth/user":{get:{operationId:"AuthController_getUser",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/UserResponseDto"}}}}},summary:"Get Logged In User",tags:["Auth"]}},"/auth/verify-session":{get:{description:"Lightweight endpoint to verify if the current session is valid. Returns minimal information without fetching full user data.",operationId:"AuthController_verifySession",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{properties:{valid:{type:"boolean",example:!0},userId:{type:"string",example:"123e4567-e89b-12d3-a456-426614174000"},expiresAt:{type:"string",example:"2024-01-01T12:00:00.000Z"}}}}}}},summary:"Verify Session",tags:["Auth"]}},"/auth/send-email-verification":{post:{operationId:"AuthController_sendEmailVerification",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthSendEmailVerificationRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthEmailVerificationSentResponseDto"}}}}},summary:"Send email verification",tags:["Auth"]}},"/auth/verify-email":{post:{operationId:"AuthController_verifyEmail",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthVerifyEmailRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthEmailVerifiedResponseDto"}}}}},summary:"Verify Email",tags:["Auth"]}},"/auth/callback/{provider}":{get:{description:"OAuth callback endpoint for SSO providers. Exchanges authorization code for access token and returns raw SSO user info. Returns HTML page that posts SSO data to parent window and auto-closes.",operationId:"AuthController_ssoCallback",parameters:[{name:"provider",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},summary:"SSO Callback",tags:["Auth"]}},"/auth/mfa/status":{get:{operationId:"MfaController_getStatus",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/MfaStatusResponseDto"}}}}},summary:"Get MFA status for the current user",tags:["Mfa"]}},"/auth/mfa/toggle":{post:{operationId:"MfaController_toggleMfa",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthToggleMfaRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthMfaToggleResponseDto"}}}}},summary:"Enable or disable MFA for the current user",tags:["Mfa"]}},"/auth/mfa/devices":{get:{operationId:"MfaController_listDevices",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/MfaDeviceDto"}}}}}},summary:"List registered MFA devices",tags:["Mfa"]}},"/auth/mfa/devices/{deviceId}":{delete:{operationId:"MfaController_removeDevice",parameters:[{name:"deviceId",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthMfaDeviceRemovedResponseDto"}}}}},summary:"Remove a registered MFA device",tags:["Mfa"]}},"/auth/mfa/setup-totp":{post:{operationId:"MfaController_setupTotp",parameters:[],responses:{200:{description:""}},summary:"Setup TOTP Device",tags:["Mfa"]}},"/auth/mfa/verify-totp-setup":{post:{operationId:"MfaController_verifyTotpSetup",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthVerifyTotpSetupRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthMfaDeviceVerifiedResponseDto"}}}}},summary:"Verify TOTP Setup",tags:["Mfa"]}},"/auth/mfa/generate-recovery-code":{post:{operationId:"MfaController_generateRecoveryCodes",parameters:[],responses:{200:{description:""}},summary:"Generate Recovery Codes",tags:["Mfa"]}},"/auth/mfa/reset-totp":{post:{operationId:"MfaController_resetTotp",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthMfaResetResponseDto"}}}}},summary:"Reset TOTP Device",tags:["Mfa"]}}},SSt={title:"@ackplus/nest-auth API",description:"OpenAPI specification generated from the Nest Auth module",version:"1.1.47",contact:{}},wSt=[],xSt=[],ESt={securitySchemes:{bearer:{scheme:"bearer",bearerFormat:"JWT",type:"http"}},schemas:{NestAuthSignupRequestDto:{type:"object",properties:{email:{type:"string",description:"User email address (required if phone not provided)",example:"user@example.com"},phone:{type:"string",description:"User phone number (required if email not provided)",example:"+1234567890"},password:{type:"string",description:"User password",example:"SecurePass123!",minLength:8},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"},guard:{type:"string",description:"Guard context (e.g. admin, web, vendor) for isolation. Deprecated: use client",example:"admin",deprecated:!0}},required:["password"]},UserResponseDto:{type:"object",properties:{id:{type:"string",description:"User unique identifier",example:"123e4567-e89b-12d3-a456-426614174000"},email:{type:"string",description:"User email address",example:"user@example.com"},phone:{type:"string",description:"User phone number",example:"+1234567890"},isVerified:{type:"boolean",description:"Email verification status",example:!0},isMfaEnabled:{type:"boolean",description:"Whether MFA is enabled for this user",example:!1},roles:{description:"User roles (role names)",example:["admin","user"],type:"array",items:{type:"string"}},permissions:{description:"User permissions (flattened from roles)",example:["read:users","write:users"],type:"array",items:{type:"string"}},metadata:{type:"object",description:"Additional user metadata",example:{firstName:"John",lastName:"Doe"}},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"tenant-123"}},required:["id","isVerified"]},AuthWithTokensResponseDto:{type:"object",properties:{accessToken:{type:"string",description:"JWT access token (short-lived)",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJpYXQiOjE2OTk5OTk5OTksImV4cCI6MTY5OTk5OTk5OX0.xyz"},refreshToken:{type:"string",description:"JWT refresh token (long-lived)",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJ0eXBlIjoicmVmcmVzaCIsImlhdCI6MTY5OTk5OTk5OX0.abc"},message:{type:"string",description:"Success message (added by controller based on configuration)",example:"Login successful"},isRequiresMfa:{type:"boolean",description:"Whether multi-factor authentication is required",example:!1},mfaMethods:{type:"array",description:"Available MFA methods when isRequiresMfa is true",example:["email","totp"],items:{type:"string",enum:["email","sms","totp"]}},defaultMfaMethod:{type:"string",description:"Default/recommended MFA method",example:"email",enum:["email","sms","totp"]},user:{description:"User information",allOf:[{$ref:"#/components/schemas/UserResponseDto"}]}},required:["accessToken","refreshToken","isRequiresMfa"]},EmailCredentialsDto:{type:"object",properties:{email:{type:"string",description:"User email address",example:"user@example.com"},password:{type:"string",description:"User password",example:"SecurePass123!",minLength:8}},required:["email","password"]},PhoneCredentialsDto:{type:"object",properties:{phone:{type:"string",description:"User phone number",example:"+1234567890"},password:{type:"string",description:"User password",example:"SecurePass123!",minLength:8}},required:["phone","password"]},SocialCredentialsDto:{type:"object",properties:{token:{type:"string",description:"OAuth token or ID token from social provider",example:"ya29.a0AfH6SMBx1234567890abcdefghijklmnop"}},required:["token"]},NestAuthLoginRequestDto:{type:"object",properties:{providerName:{type:"string",description:"Authentication provider name",example:"email",enum:["email","phone","google","facebook","apple","github"],default:"email"},credentials:{description:"Login credentials - type varies by provider",examples:{emailLogin:{summary:"Email Login",value:{email:"user@example.com",password:"SecurePass123!"}},phoneLogin:{summary:"Phone Login",value:{phone:"+1234567890",password:"SecurePass123!"}},socialLogin:{summary:"Social Login (Google/Facebook/etc)",value:{token:"ya29.a0AfH6SMBx...",type:"idToken"}}},oneOf:[{$ref:"#/components/schemas/EmailCredentialsDto"},{$ref:"#/components/schemas/PhoneCredentialsDto"},{$ref:"#/components/schemas/SocialCredentialsDto"}]},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"},guard:{type:"string",description:"Guard context (e.g. admin, web, vendor) for isolation. Deprecated: use client",example:"admin",deprecated:!0},createUserIfNotExists:{type:"boolean",description:"Auto-create user if not exists (for social auth)",default:!1}},required:["credentials"]},NestAuthRefreshTokenRequestDto:{type:"object",properties:{refreshToken:{type:"string",description:"Refresh token to obtain new access token",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJ0eXBlIjoicmVmcmVzaCJ9.abc123"}},required:["refreshToken"]},NestAuthMfaCodeSentResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"MFA code sent successfully"}},required:["message"]},NestAuthMFAMethodEnum:{type:"string",enum:["email","sms","totp"]},NestAuthVerify2faRequestDto:{type:"object",properties:{method:{description:"MFA method used",example:"totp",allOf:[{$ref:"#/components/schemas/NestAuthMFAMethodEnum"}]},otp:{type:"string",description:"One-time password code",example:"123456",minLength:6,maxLength:8},rememberDevice:{type:"boolean",description:"Whether to trust this device for future logins",example:!0}},required:["method","otp"]},Verify2faWithTokensResponseDto:{type:"object",properties:{accessToken:{type:"string",description:"JWT access token (short-lived)",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJpYXQiOjE2OTk5OTk5OTksImV4cCI6MTY5OTk5OTk5OX0.xyz"},refreshToken:{type:"string",description:"JWT refresh token (long-lived)",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJ0eXBlIjoicmVmcmVzaCIsImlhdCI6MTY5OTk5OTk5OX0.abc"},message:{type:"string",description:"Verification success message (added by controller)",example:"2FA verification successful"}},required:["accessToken","refreshToken"]},NestAuthLogoutResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Logged out successfully"}},required:["message"]},NestAuthLogoutAllResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Logged out from all devices"}},required:["message"]},NestAuthChangePasswordRequestDto:{type:"object",properties:{currentPassword:{type:"string",description:"Current password",example:"DemoOwner1!",minLength:8},newPassword:{type:"string",description:"New password",example:"DemoOwner1!New",minLength:8}},required:["currentPassword","newPassword"]},NestAuthForgotPasswordRequestDto:{type:"object",properties:{email:{type:"string",description:"User email address (required if phone not provided)",example:"user@example.com"},phone:{type:"string",description:"User phone number (required if email not provided)",example:"+1234567890"},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"}}},NestAuthPasswordResetLinkSentResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"If your email is registered, you will receive a password reset link"}},required:["message"]},NestAuthVerifyForgotPasswordOtpRequestDto:{type:"object",properties:{email:{type:"string",description:"User email address (required if phone not provided)",example:"user@example.com"},phone:{type:"string",description:"User phone number (required if email not provided)",example:"+1234567890"},otp:{type:"string",description:"One-time password code received via email or SMS",example:"123456",minLength:6,maxLength:8},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"}},required:["otp"]},VerifyOtpResponseDto:{type:"object",properties:{message:{type:"string",description:"Success message"},resetToken:{type:"string",description:"Password reset token - use this to reset password"}},required:["message"]},NestAuthResetPasswordWithTokenRequestDto:{type:"object",properties:{token:{type:"string",description:"Password reset token (JWT) received after OTP verification",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoicGFzc3dvcmQtcmVzZXQifQ.xyz"},newPassword:{type:"string",description:"New password",example:"NewSecurePass123!",minLength:8}},required:["token","newPassword"]},NestAuthPasswordResetResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Password has been reset successfully"}},required:["message"]},NestAuthSendEmailVerificationRequestDto:{type:"object",properties:{tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"}}},NestAuthEmailVerificationSentResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Verification email sent"}},required:["message"]},NestAuthVerifyEmailRequestDto:{type:"object",properties:{otp:{type:"string",description:"One-time password code received via email",example:"123456",minLength:6,maxLength:8},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"}},required:["otp"]},NestAuthEmailVerifiedResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Email verified successfully"}},required:["message"]},MfaDeviceDto:{type:"object",properties:{id:{type:"string",description:"Unique identifier of the MFA device",example:"4b3c9c9c-9a9d-4d1e-8d9f-123456789abc"},deviceName:{type:"string",description:"Friendly name of the registered device",example:"Work laptop"},method:{type:"string",description:"MFA method this device supports",enum:["email","sms","totp"],example:"totp"},lastUsedAt:{format:"date-time",type:"string",description:"Timestamp of when the device was last used",example:"2024-05-20T12:34:56.000Z"},verified:{type:"boolean",description:"Whether the device setup has been verified",example:!0},createdAt:{format:"date-time",type:"string",description:"Timestamp of when the device was registered",example:"2024-05-18T10:15:00.000Z"}},required:["id","deviceName","method","verified"]},MfaStatusResponseDto:{type:"object",properties:{isEnabled:{type:"boolean",description:"Whether MFA is currently enabled for the user",example:!0},verifiedMethods:{type:"array",description:"MFA methods the user has verified and can currently use (includes EMAIL/SMS if configured, and TOTP if user has verified device)",example:["email","totp"],items:{type:"string",enum:["email","sms","totp"]}},configuredMethods:{type:"array",description:"All MFA methods configured and available in the application (methods user can potentially set up)",example:["email","totp","sms"],items:{type:"string",enum:["email","sms","totp"]}},allowUserToggle:{type:"boolean",description:"Indicates if MFA toggling is allowed for the user",example:!0},allowMethodSelection:{type:"boolean",description:"Indicates if users can choose their preferred MFA method",example:!0},totpDevices:{description:"Registered TOTP devices for the user",type:"array",items:{$ref:"#/components/schemas/MfaDeviceDto"}},hasRecoveryCode:{type:"boolean",description:"Whether a recovery code has been generated for the user",example:!1}},required:["isEnabled","verifiedMethods","configuredMethods","allowUserToggle","allowMethodSelection","totpDevices","hasRecoveryCode"]},NestAuthToggleMfaRequestDto:{type:"object",properties:{enabled:{type:"boolean",description:"Whether MFA should be enabled for the current user",example:!0}},required:["enabled"]},NestAuthMfaToggleResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"MFA enabled successfully"}},required:["message"]},NestAuthMfaDeviceRemovedResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Device removed successfully"}},required:["message"]},NestAuthSendMfaCodeRequestDto:{type:"object",properties:{method:{description:"MFA delivery method",example:"email",examples:{email:{value:"email",description:"Send OTP via email"},sms:{value:"sms",description:"Send OTP via SMS"},totp:{value:"totp",description:"Use authenticator app (TOTP)"}},allOf:[{$ref:"#/components/schemas/NestAuthMFAMethodEnum"}]}},required:["method"]},NestAuthVerifyTotpSetupRequestDto:{type:"object",properties:{otp:{type:"string",description:"The TOTP code from authenticator app",example:"123456",minLength:6,maxLength:6},secret:{type:"string",description:"Secret key from TOTP setup",example:"JBSWY3DPEHPK3PXP"}},required:["otp","secret"]},NestAuthMfaDeviceVerifiedResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Device setup successfully"}},required:["message"]},NestAuthMfaResetResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"MFA reset successfully"}},required:["message"]}}},kSt={openapi:vSt,paths:OSt,info:SSt,tags:wSt,servers:xSt,components:ESt},q2=({content:e})=>k.jsx(Byt,{remarkPlugins:[UC],components:{code({node:t,inline:n,className:r,children:a,...i}){const o=/language-(\w+)/.exec(r||"");return!n&&o?k.jsx(Mve,{...i,style:pSt,language:o[1],PreTag:"div",customStyle:{margin:0,borderRadius:"0.5rem",fontSize:"0.875rem"},children:String(a).replace(/\n$/,"")}):k.jsx("code",{...i,className:`${r} bg-gray-100 text-gray-800 rounded px-1 py-0.5 text-sm font-mono`,children:a})},table({children:t}){return k.jsx("div",{className:"overflow-x-auto my-4 border border-gray-200 rounded-lg",children:k.jsx("table",{className:"min-w-full divide-y divide-gray-200",children:t})})},thead({children:t}){return k.jsx("thead",{className:"bg-gray-50",children:t})},th({children:t}){return k.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:t})},td({children:t}){return k.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 border-t border-gray-200",children:t})},a({href:t,children:n}){return k.jsx("a",{href:t,className:"text-primary-600 hover:text-primary-800 hover:underline",target:"_blank",rel:"noopener noreferrer",children:n})},h2({children:t}){return k.jsx("h2",{className:"text-2xl font-bold text-gray-900 mt-8 mb-4 pb-2 border-b border-gray-200",children:t})},h3({children:t}){return k.jsx("h3",{className:"text-xl font-semibold text-gray-900 mt-6 mb-3",children:t})},p({children:t}){return k.jsx("p",{className:"text-gray-700 leading-relaxed mb-4",children:t})},ul({children:t}){return k.jsx("ul",{className:"list-disc list-inside space-y-1 mb-4 text-gray-700",children:t})},li({children:t}){return k.jsx("li",{className:"ml-4",children:t})},blockquote({children:t}){return k.jsx("blockquote",{className:"border-l-4 border-primary-500 pl-4 py-1 my-4 bg-primary-50 text-gray-700 italic rounded-r",children:t})}},children:e}),_St=()=>{const[e,t]=ee.useState(!1),[n,r]=ee.useState(null),[a,i]=ee.useState("api");ee.useEffect(()=>{const l=kSt||{};!l||!l.paths||Object.keys(l.paths||{}).length===0?t(!0):r(l)},[]);const o=()=>{if(!n)return;const l=JSON.stringify(n,null,2),c=new Blob([l],{type:"application/json"}),u=URL.createObjectURL(c),d=document.createElement("a");d.href=u,d.download="nest-auth-api.json",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u)},s=[{id:"api",label:"API Explorer",icon:g7},{id:"config",label:"Configuration",icon:CFe},{id:"examples",label:"Examples",icon:tee},{id:"events",label:"Events",icon:PFe},{id:"api-reference",label:"API Reference",icon:wFe},{id:"services",label:"Services",icon:tee}];return k.jsxs("div",{className:"space-y-6",children:[k.jsx(Dv,{title:"API Documentation",description:"Comprehensive guide and interactive API documentation.",action:a==="api"&&k.jsxs("button",{onClick:o,className:"btn-secondary flex items-center gap-2",disabled:e,children:[k.jsx(TFe,{className:"w-4 h-4"}),"Download JSON"]})}),k.jsx("div",{className:"border-b border-gray-200",children:k.jsx("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:s.map(l=>{const c=l.icon;return k.jsxs("button",{onClick:()=>i(l.id),className:`
|
|
5210
|
+
- Cookie mode: Sets tokens in HTTP-only cookies and returns success message`,operationId:"AuthController_verify2fa",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthVerify2faRequestDto"}}}},responses:{200:{description:"Header mode: Returns message + tokens in body",content:{"application/json":{schema:{$ref:"#/components/schemas/Verify2faWithTokensResponseDto"}}}}},summary:"Verify MFA",tags:["Auth"]}},"/auth/logout":{post:{operationId:"AuthController_logout",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthLogoutResponseDto"}}}}},summary:"Logout",tags:["Auth"]}},"/auth/logout-all":{post:{operationId:"AuthController_logoutAll",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthLogoutAllResponseDto"}}}}},summary:"Logout All",tags:["Auth"]}},"/auth/change-password":{post:{operationId:"AuthController_changePassword",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthChangePasswordRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/AuthWithTokensResponseDto"}}}}},summary:"Change Password",tags:["Auth"]}},"/auth/forgot-password":{post:{operationId:"AuthController_forgotPassword",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthForgotPasswordRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthPasswordResetLinkSentResponseDto"}}}}},summary:"Forgot password",tags:["Auth"]}},"/auth/verify-forgot-password-otp":{post:{operationId:"AuthController_verifyForgotPasswordOtp",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthVerifyForgotPasswordOtpRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/VerifyOtpResponseDto"}}}}},summary:"Verify Forgot Password OTP and get reset token",tags:["Auth"]}},"/auth/reset-password":{post:{operationId:"AuthController_resetPassword",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthResetPasswordWithTokenRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthPasswordResetResponseDto"}}}}},summary:"Reset password",tags:["Auth"]}},"/auth/user":{get:{operationId:"AuthController_getUser",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/UserResponseDto"}}}}},summary:"Get Logged In User",tags:["Auth"]}},"/auth/verify-session":{get:{description:"Lightweight endpoint to verify if the current session is valid. Returns minimal information without fetching full user data.",operationId:"AuthController_verifySession",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{properties:{valid:{type:"boolean",example:!0},userId:{type:"string",example:"123e4567-e89b-12d3-a456-426614174000"},expiresAt:{type:"string",example:"2024-01-01T12:00:00.000Z"}}}}}}},summary:"Verify Session",tags:["Auth"]}},"/auth/send-email-verification":{post:{operationId:"AuthController_sendEmailVerification",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthSendEmailVerificationRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthEmailVerificationSentResponseDto"}}}}},summary:"Send email verification",tags:["Auth"]}},"/auth/verify-email":{post:{operationId:"AuthController_verifyEmail",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthVerifyEmailRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthEmailVerifiedResponseDto"}}}}},summary:"Verify Email",tags:["Auth"]}},"/auth/callback/{provider}":{get:{description:"OAuth callback endpoint for SSO providers. Exchanges authorization code for access token and returns raw SSO user info. Returns HTML page that posts SSO data to parent window and auto-closes.",operationId:"AuthController_ssoCallback",parameters:[{name:"provider",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},summary:"SSO Callback",tags:["Auth"]}},"/auth/mfa/status":{get:{operationId:"MfaController_getStatus",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/MfaStatusResponseDto"}}}}},summary:"Get MFA status for the current user",tags:["Mfa"]}},"/auth/mfa/toggle":{post:{operationId:"MfaController_toggleMfa",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthToggleMfaRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthMfaToggleResponseDto"}}}}},summary:"Enable or disable MFA for the current user",tags:["Mfa"]}},"/auth/mfa/devices":{get:{operationId:"MfaController_listDevices",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/MfaDeviceDto"}}}}}},summary:"List registered MFA devices",tags:["Mfa"]}},"/auth/mfa/devices/{deviceId}":{delete:{operationId:"MfaController_removeDevice",parameters:[{name:"deviceId",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthMfaDeviceRemovedResponseDto"}}}}},summary:"Remove a registered MFA device",tags:["Mfa"]}},"/auth/mfa/setup-totp":{post:{operationId:"MfaController_setupTotp",parameters:[],responses:{200:{description:""}},summary:"Setup TOTP Device",tags:["Mfa"]}},"/auth/mfa/verify-totp-setup":{post:{operationId:"MfaController_verifyTotpSetup",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthVerifyTotpSetupRequestDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthMfaDeviceVerifiedResponseDto"}}}}},summary:"Verify TOTP Setup",tags:["Mfa"]}},"/auth/mfa/generate-recovery-code":{post:{operationId:"MfaController_generateRecoveryCodes",parameters:[],responses:{200:{description:""}},summary:"Generate Recovery Codes",tags:["Mfa"]}},"/auth/mfa/reset-totp":{post:{operationId:"MfaController_resetTotp",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/NestAuthMfaResetResponseDto"}}}}},summary:"Reset TOTP Device",tags:["Mfa"]}}},SSt={title:"@ackplus/nest-auth API",description:"OpenAPI specification generated from the Nest Auth module",version:"1.1.49",contact:{}},wSt=[],xSt=[],ESt={securitySchemes:{bearer:{scheme:"bearer",bearerFormat:"JWT",type:"http"}},schemas:{NestAuthSignupRequestDto:{type:"object",properties:{email:{type:"string",description:"User email address (required if phone not provided)",example:"user@example.com"},phone:{type:"string",description:"User phone number (required if email not provided)",example:"+1234567890"},password:{type:"string",description:"User password",example:"SecurePass123!",minLength:8},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"},guard:{type:"string",description:"Guard context (e.g. admin, web, vendor) for isolation. Deprecated: use client",example:"admin",deprecated:!0}},required:["password"]},UserResponseDto:{type:"object",properties:{id:{type:"string",description:"User unique identifier",example:"123e4567-e89b-12d3-a456-426614174000"},email:{type:"string",description:"User email address",example:"user@example.com"},phone:{type:"string",description:"User phone number",example:"+1234567890"},isVerified:{type:"boolean",description:"Email verification status",example:!0},isMfaEnabled:{type:"boolean",description:"Whether MFA is enabled for this user",example:!1},roles:{description:"User roles (role names)",example:["admin","user"],type:"array",items:{type:"string"}},permissions:{description:"User permissions (flattened from roles)",example:["read:users","write:users"],type:"array",items:{type:"string"}},metadata:{type:"object",description:"Additional user metadata",example:{firstName:"John",lastName:"Doe"}},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"tenant-123"}},required:["id","isVerified"]},AuthWithTokensResponseDto:{type:"object",properties:{accessToken:{type:"string",description:"JWT access token (short-lived)",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJpYXQiOjE2OTk5OTk5OTksImV4cCI6MTY5OTk5OTk5OX0.xyz"},refreshToken:{type:"string",description:"JWT refresh token (long-lived)",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJ0eXBlIjoicmVmcmVzaCIsImlhdCI6MTY5OTk5OTk5OX0.abc"},message:{type:"string",description:"Success message (added by controller based on configuration)",example:"Login successful"},isRequiresMfa:{type:"boolean",description:"Whether multi-factor authentication is required",example:!1},mfaMethods:{type:"array",description:"Available MFA methods when isRequiresMfa is true",example:["email","totp"],items:{type:"string",enum:["email","sms","totp"]}},defaultMfaMethod:{type:"string",description:"Default/recommended MFA method",example:"email",enum:["email","sms","totp"]},user:{description:"User information",allOf:[{$ref:"#/components/schemas/UserResponseDto"}]}},required:["accessToken","refreshToken","isRequiresMfa"]},EmailCredentialsDto:{type:"object",properties:{email:{type:"string",description:"User email address",example:"user@example.com"},password:{type:"string",description:"User password",example:"SecurePass123!",minLength:8}},required:["email","password"]},PhoneCredentialsDto:{type:"object",properties:{phone:{type:"string",description:"User phone number",example:"+1234567890"},password:{type:"string",description:"User password",example:"SecurePass123!",minLength:8}},required:["phone","password"]},SocialCredentialsDto:{type:"object",properties:{token:{type:"string",description:"OAuth token or ID token from social provider",example:"ya29.a0AfH6SMBx1234567890abcdefghijklmnop"}},required:["token"]},NestAuthLoginRequestDto:{type:"object",properties:{providerName:{type:"string",description:"Authentication provider name",example:"email",enum:["email","phone","google","facebook","apple","github"],default:"email"},credentials:{description:"Login credentials - type varies by provider",examples:{emailLogin:{summary:"Email Login",value:{email:"user@example.com",password:"SecurePass123!"}},phoneLogin:{summary:"Phone Login",value:{phone:"+1234567890",password:"SecurePass123!"}},socialLogin:{summary:"Social Login (Google/Facebook/etc)",value:{token:"ya29.a0AfH6SMBx...",type:"idToken"}}},oneOf:[{$ref:"#/components/schemas/EmailCredentialsDto"},{$ref:"#/components/schemas/PhoneCredentialsDto"},{$ref:"#/components/schemas/SocialCredentialsDto"}]},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"},guard:{type:"string",description:"Guard context (e.g. admin, web, vendor) for isolation. Deprecated: use client",example:"admin",deprecated:!0},createUserIfNotExists:{type:"boolean",description:"Auto-create user if not exists (for social auth)",default:!1}},required:["credentials"]},NestAuthRefreshTokenRequestDto:{type:"object",properties:{refreshToken:{type:"string",description:"Refresh token to obtain new access token",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJ0eXBlIjoicmVmcmVzaCJ9.abc123"}},required:["refreshToken"]},NestAuthMfaCodeSentResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"MFA code sent successfully"}},required:["message"]},NestAuthMFAMethodEnum:{type:"string",enum:["email","sms","totp"]},NestAuthVerify2faRequestDto:{type:"object",properties:{method:{description:"MFA method used",example:"totp",allOf:[{$ref:"#/components/schemas/NestAuthMFAMethodEnum"}]},otp:{type:"string",description:"One-time password code",example:"123456",minLength:6,maxLength:8},rememberDevice:{type:"boolean",description:"Whether to trust this device for future logins",example:!0}},required:["method","otp"]},Verify2faWithTokensResponseDto:{type:"object",properties:{accessToken:{type:"string",description:"JWT access token (short-lived)",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJpYXQiOjE2OTk5OTk5OTksImV4cCI6MTY5OTk5OTk5OX0.xyz"},refreshToken:{type:"string",description:"JWT refresh token (long-lived)",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJ0eXBlIjoicmVmcmVzaCIsImlhdCI6MTY5OTk5OTk5OX0.abc"},message:{type:"string",description:"Verification success message (added by controller)",example:"2FA verification successful"}},required:["accessToken","refreshToken"]},NestAuthLogoutResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Logged out successfully"}},required:["message"]},NestAuthLogoutAllResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Logged out from all devices"}},required:["message"]},NestAuthChangePasswordRequestDto:{type:"object",properties:{currentPassword:{type:"string",description:"Current password",example:"DemoOwner1!",minLength:8},newPassword:{type:"string",description:"New password",example:"DemoOwner1!New",minLength:8}},required:["currentPassword","newPassword"]},NestAuthForgotPasswordRequestDto:{type:"object",properties:{email:{type:"string",description:"User email address (required if phone not provided)",example:"user@example.com"},phone:{type:"string",description:"User phone number (required if email not provided)",example:"+1234567890"},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"}}},NestAuthPasswordResetLinkSentResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"If your email is registered, you will receive a password reset link"}},required:["message"]},NestAuthVerifyForgotPasswordOtpRequestDto:{type:"object",properties:{email:{type:"string",description:"User email address (required if phone not provided)",example:"user@example.com"},phone:{type:"string",description:"User phone number (required if email not provided)",example:"+1234567890"},otp:{type:"string",description:"One-time password code received via email or SMS",example:"123456",minLength:6,maxLength:8},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"}},required:["otp"]},VerifyOtpResponseDto:{type:"object",properties:{message:{type:"string",description:"Success message"},resetToken:{type:"string",description:"Password reset token - use this to reset password"}},required:["message"]},NestAuthResetPasswordWithTokenRequestDto:{type:"object",properties:{token:{type:"string",description:"Password reset token (JWT) received after OTP verification",example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoicGFzc3dvcmQtcmVzZXQifQ.xyz"},newPassword:{type:"string",description:"New password",example:"NewSecurePass123!",minLength:8}},required:["token","newPassword"]},NestAuthPasswordResetResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Password has been reset successfully"}},required:["message"]},NestAuthSendEmailVerificationRequestDto:{type:"object",properties:{tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"}}},NestAuthEmailVerificationSentResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Verification email sent"}},required:["message"]},NestAuthVerifyEmailRequestDto:{type:"object",properties:{otp:{type:"string",description:"One-time password code received via email",example:"123456",minLength:6,maxLength:8},tenantId:{type:"string",description:"Tenant ID for multi-tenant applications",example:"123e4567-e89b-12d3-a456-426614174000"}},required:["otp"]},NestAuthEmailVerifiedResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Email verified successfully"}},required:["message"]},MfaDeviceDto:{type:"object",properties:{id:{type:"string",description:"Unique identifier of the MFA device",example:"4b3c9c9c-9a9d-4d1e-8d9f-123456789abc"},deviceName:{type:"string",description:"Friendly name of the registered device",example:"Work laptop"},method:{type:"string",description:"MFA method this device supports",enum:["email","sms","totp"],example:"totp"},lastUsedAt:{format:"date-time",type:"string",description:"Timestamp of when the device was last used",example:"2024-05-20T12:34:56.000Z"},verified:{type:"boolean",description:"Whether the device setup has been verified",example:!0},createdAt:{format:"date-time",type:"string",description:"Timestamp of when the device was registered",example:"2024-05-18T10:15:00.000Z"}},required:["id","deviceName","method","verified"]},MfaStatusResponseDto:{type:"object",properties:{isEnabled:{type:"boolean",description:"Whether MFA is currently enabled for the user",example:!0},verifiedMethods:{type:"array",description:"MFA methods the user has verified and can currently use (includes EMAIL/SMS if configured, and TOTP if user has verified device)",example:["email","totp"],items:{type:"string",enum:["email","sms","totp"]}},configuredMethods:{type:"array",description:"All MFA methods configured and available in the application (methods user can potentially set up)",example:["email","totp","sms"],items:{type:"string",enum:["email","sms","totp"]}},allowUserToggle:{type:"boolean",description:"Indicates if MFA toggling is allowed for the user",example:!0},allowMethodSelection:{type:"boolean",description:"Indicates if users can choose their preferred MFA method",example:!0},totpDevices:{description:"Registered TOTP devices for the user",type:"array",items:{$ref:"#/components/schemas/MfaDeviceDto"}},hasRecoveryCode:{type:"boolean",description:"Whether a recovery code has been generated for the user",example:!1}},required:["isEnabled","verifiedMethods","configuredMethods","allowUserToggle","allowMethodSelection","totpDevices","hasRecoveryCode"]},NestAuthToggleMfaRequestDto:{type:"object",properties:{enabled:{type:"boolean",description:"Whether MFA should be enabled for the current user",example:!0}},required:["enabled"]},NestAuthMfaToggleResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"MFA enabled successfully"}},required:["message"]},NestAuthMfaDeviceRemovedResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Device removed successfully"}},required:["message"]},NestAuthSendMfaCodeRequestDto:{type:"object",properties:{method:{description:"MFA delivery method",example:"email",examples:{email:{value:"email",description:"Send OTP via email"},sms:{value:"sms",description:"Send OTP via SMS"},totp:{value:"totp",description:"Use authenticator app (TOTP)"}},allOf:[{$ref:"#/components/schemas/NestAuthMFAMethodEnum"}]}},required:["method"]},NestAuthVerifyTotpSetupRequestDto:{type:"object",properties:{otp:{type:"string",description:"The TOTP code from authenticator app",example:"123456",minLength:6,maxLength:6},secret:{type:"string",description:"Secret key from TOTP setup",example:"JBSWY3DPEHPK3PXP"}},required:["otp","secret"]},NestAuthMfaDeviceVerifiedResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"Device setup successfully"}},required:["message"]},NestAuthMfaResetResponseDto:{type:"object",properties:{message:{type:"string",description:"Response message",example:"MFA reset successfully"}},required:["message"]}}},kSt={openapi:vSt,paths:OSt,info:SSt,tags:wSt,servers:xSt,components:ESt},q2=({content:e})=>k.jsx(Byt,{remarkPlugins:[UC],components:{code({node:t,inline:n,className:r,children:a,...i}){const o=/language-(\w+)/.exec(r||"");return!n&&o?k.jsx(Mve,{...i,style:pSt,language:o[1],PreTag:"div",customStyle:{margin:0,borderRadius:"0.5rem",fontSize:"0.875rem"},children:String(a).replace(/\n$/,"")}):k.jsx("code",{...i,className:`${r} bg-gray-100 text-gray-800 rounded px-1 py-0.5 text-sm font-mono`,children:a})},table({children:t}){return k.jsx("div",{className:"overflow-x-auto my-4 border border-gray-200 rounded-lg",children:k.jsx("table",{className:"min-w-full divide-y divide-gray-200",children:t})})},thead({children:t}){return k.jsx("thead",{className:"bg-gray-50",children:t})},th({children:t}){return k.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:t})},td({children:t}){return k.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 border-t border-gray-200",children:t})},a({href:t,children:n}){return k.jsx("a",{href:t,className:"text-primary-600 hover:text-primary-800 hover:underline",target:"_blank",rel:"noopener noreferrer",children:n})},h2({children:t}){return k.jsx("h2",{className:"text-2xl font-bold text-gray-900 mt-8 mb-4 pb-2 border-b border-gray-200",children:t})},h3({children:t}){return k.jsx("h3",{className:"text-xl font-semibold text-gray-900 mt-6 mb-3",children:t})},p({children:t}){return k.jsx("p",{className:"text-gray-700 leading-relaxed mb-4",children:t})},ul({children:t}){return k.jsx("ul",{className:"list-disc list-inside space-y-1 mb-4 text-gray-700",children:t})},li({children:t}){return k.jsx("li",{className:"ml-4",children:t})},blockquote({children:t}){return k.jsx("blockquote",{className:"border-l-4 border-primary-500 pl-4 py-1 my-4 bg-primary-50 text-gray-700 italic rounded-r",children:t})}},children:e}),_St=()=>{const[e,t]=ee.useState(!1),[n,r]=ee.useState(null),[a,i]=ee.useState("api");ee.useEffect(()=>{const l=kSt||{};!l||!l.paths||Object.keys(l.paths||{}).length===0?t(!0):r(l)},[]);const o=()=>{if(!n)return;const l=JSON.stringify(n,null,2),c=new Blob([l],{type:"application/json"}),u=URL.createObjectURL(c),d=document.createElement("a");d.href=u,d.download="nest-auth-api.json",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u)},s=[{id:"api",label:"API Explorer",icon:g7},{id:"config",label:"Configuration",icon:CFe},{id:"examples",label:"Examples",icon:tee},{id:"events",label:"Events",icon:PFe},{id:"api-reference",label:"API Reference",icon:wFe},{id:"services",label:"Services",icon:tee}];return k.jsxs("div",{className:"space-y-6",children:[k.jsx(Dv,{title:"API Documentation",description:"Comprehensive guide and interactive API documentation.",action:a==="api"&&k.jsxs("button",{onClick:o,className:"btn-secondary flex items-center gap-2",disabled:e,children:[k.jsx(TFe,{className:"w-4 h-4"}),"Download JSON"]})}),k.jsx("div",{className:"border-b border-gray-200",children:k.jsx("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:s.map(l=>{const c=l.icon;return k.jsxs("button",{onClick:()=>i(l.id),className:`
|
|
5211
5211
|
whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm flex items-center gap-2 transition-colors
|
|
5212
5212
|
${a===l.id?"border-primary-500 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}
|
|
5213
5213
|
`,children:[k.jsx(c,{className:"w-4 h-4"}),l.label]},l.id)})})}),a==="api"&&(e?k.jsx("div",{className:"card",children:k.jsx("div",{className:"p-6 text-center",children:k.jsxs("div",{className:"p-4 bg-amber-50 border border-amber-200 rounded-lg flex items-start gap-3 mb-4",children:[k.jsx(Wl,{className:"w-5 h-5 text-amber-600 flex-shrink-0 mt-0.5"}),k.jsxs("div",{className:"text-left",children:[k.jsx("p",{className:"font-semibold text-amber-900 mb-1",children:"API Documentation Not Available"}),k.jsx("p",{className:"text-sm text-amber-800",children:"The OpenAPI specification file could not be loaded. Make sure the OpenAPI spec has been generated by running the build process."})]})]})})}):k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"card bg-blue-50 border-blue-200",children:k.jsxs("div",{className:"p-4 flex items-start gap-3",children:[k.jsx(g7,{className:"w-5 h-5 text-blue-600 flex-shrink-0 mt-0.5"}),k.jsxs("div",{className:"flex-1",children:[k.jsx("p",{className:"text-sm font-medium text-blue-900 mb-1",children:"Interactive API Documentation"}),k.jsx("p",{className:"text-sm text-blue-800",children:'This documentation is auto-generated from the OpenAPI specification. You can test endpoints directly from this page. Click "Download JSON" to get the raw OpenAPI specification file for importing into Postman or other API tools.'})]})]})}),n&&k.jsx(O0t,{spec:n})]})),a==="config"&&k.jsx("div",{className:"card p-8",children:k.jsx("div",{className:"prose prose-blue max-w-none",children:k.jsx(q2,{content:mSt})})}),a==="examples"&&k.jsx("div",{className:"card p-8",children:k.jsx("div",{className:"prose prose-blue max-w-none",children:k.jsx(q2,{content:hSt})})}),a==="events"&&k.jsx("div",{className:"card p-8",children:k.jsx("div",{className:"prose prose-blue max-w-none",children:k.jsx(q2,{content:gSt})})}),a==="api-reference"&&k.jsx("div",{className:"card p-8",children:k.jsx("div",{className:"prose prose-blue max-w-none",children:k.jsx(q2,{content:bSt})})}),a==="services"&&k.jsx("div",{className:"card p-8",children:k.jsx("div",{className:"prose prose-blue max-w-none",children:k.jsx(q2,{content:ySt})})})]})},xh=({children:e,authenticated:t})=>t===null?k.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:k.jsxs("div",{className:"text-center",children:[k.jsx("div",{className:"animate-spin rounded-full h-16 w-16 border-b-4 border-primary-600 mx-auto mb-4"}),k.jsx("p",{className:"text-gray-600 font-medium",children:"Verifying authentication..."})]})}):t?k.jsx(k.Fragment,{children:e}):k.jsx(b1,{to:"/login",replace:!0}),TSt=()=>{const[e,t]=ee.useState(null),[n,r]=ee.useState(null),[a,i]=ee.useState(!1),[o,s]=ee.useState(null);ee.useEffect(()=>{l()},[]);const l=async()=>{try{await cn.get("/me"),t(!0);const d=await cn.get("/config");r(d)}catch(d){console.error("Auth check failed:",d),t(!1);try{const f=await cn.get("/config");r(f)}catch(f){console.error("Failed to load config:",f),r({allowAdminManagement:!1})}}finally{i(!0)}},c=async d=>{s(null);try{await cn.post("/login",d),t(!0),await l()}catch(f){throw t(!1),s((f==null?void 0:f.message)||"Login failed"),f}},u=async()=>{try{await cn.post("/logout",{})}catch(d){console.error("Logout failed:",d)}t(!1)};return!a||n===null?k.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary-50 via-blue-50 to-purple-50 flex items-center justify-center",children:k.jsxs("div",{className:"text-center",children:[k.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-primary-600 rounded-full mb-4 shadow-lg",children:k.jsxs("svg",{className:"w-8 h-8 text-white animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[k.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),k.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),k.jsx("p",{className:"text-gray-700 font-medium text-lg",children:"Loading Nest Auth Dashboard..."}),k.jsx("p",{className:"text-gray-500 text-sm mt-2",children:"Verifying authentication"})]})}):k.jsx(vFe,{children:k.jsx(uFe,{children:k.jsxs(nFe,{children:[k.jsx(pc,{path:"/login",element:e?k.jsx(b1,{to:"/dashboard",replace:!0}):k.jsx(mBe,{onLogin:c,error:o})}),k.jsx(pc,{path:"/dashboard",element:k.jsx(xh,{authenticated:e,children:k.jsx(gh,{config:n,onLogout:u,children:k.jsx(jht,{})})})}),k.jsx(pc,{path:"/users",element:k.jsx(xh,{authenticated:e,children:k.jsx(gh,{config:n,onLogout:u,children:k.jsx(Jht,{})})})}),k.jsx(pc,{path:"/roles",element:k.jsx(xh,{authenticated:e,children:k.jsx(gh,{config:n,onLogout:u,children:k.jsx(r0t,{})})})}),k.jsx(pc,{path:"/tenants",element:k.jsx(xh,{authenticated:e,children:k.jsx(gh,{config:n,onLogout:u,children:k.jsx(l0t,{})})})}),k.jsx(pc,{path:"/permissions",element:k.jsx(xh,{authenticated:e,children:k.jsx(gh,{config:n,onLogout:u,children:k.jsx(g0t,{})})})}),k.jsx(pc,{path:"/api",element:k.jsx(xh,{authenticated:e,children:k.jsx(gh,{config:n,onLogout:u,children:k.jsx(_St,{})})})}),n.allowAdminManagement&&k.jsx(pc,{path:"/admins",element:k.jsx(xh,{authenticated:e,children:k.jsx(gh,{config:n,onLogout:u,children:k.jsx(f0t,{})})})}),k.jsx(pc,{path:"/",element:e?k.jsx(b1,{to:"/dashboard",replace:!0}):k.jsx(b1,{to:"/login",replace:!0})}),k.jsx(pc,{path:"*",element:e?k.jsx(b1,{to:"/dashboard",replace:!0}):k.jsx(b1,{to:"/login",replace:!0})})]})})})},Aie=document.getElementById("root");Aie&&vD.createRoot(Aie).render(k.jsx(fe.StrictMode,{children:k.jsx(TSt,{})}));/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.guard.d.ts","sourceRoot":"","sources":["../../../../src/lib/auth/guards/auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,gBAAgB,EAA6C,MAAM,gBAAgB,CAAC;AAEtH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAK1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAgB/D,qBACa,iBAAkB,YAAW,WAAW;IAE7C,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,WAAW;IAEnB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAPvB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,qBAAqB,EACrC,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,kBAAkB,EAEtB,cAAc,EAAE,UAAU,CAAC,YAAY,CAAC;IAGvD,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,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Hb,gBAAgB;YAwDhB,QAAQ;YA8BR,kBAAkB;IA0ChC,OAAO,CAAC,sBAAsB;IA2B9B,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;YAyBhB,UAAU;YAwCV,gBAAgB;IA+C9B,OAAO,CAAC,kBAAkB;CAiB7B"}
|
|
@@ -304,9 +304,9 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
304
304
|
const requiredGuard = this.getRequiredGuard(context);
|
|
305
305
|
if (!requiredPermissions.length && !requiredRoles.length) {
|
|
306
306
|
this.debugLogger.debug('No authorization requirements - allowing access', 'AuthGuard');
|
|
307
|
-
return;
|
|
308
307
|
}
|
|
309
308
|
const user = request.user;
|
|
309
|
+
const session = request.session;
|
|
310
310
|
if (!user) {
|
|
311
311
|
this.debugLogger.warn('Authorization check failed - no user', 'AuthGuard');
|
|
312
312
|
throw new common_1.ForbiddenException({
|
|
@@ -314,54 +314,71 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
314
314
|
code: auth_constants_1.ERROR_CODES.UNAUTHORIZED,
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
|
+
const rolesForAuth = session?.data?.roles || user.roles || [];
|
|
318
|
+
const permissionsForAuth = session?.data?.permissions;
|
|
317
319
|
if (requiredRoles.length > 0) {
|
|
318
|
-
await this.checkRoles(user, requiredRoles, requiredGuard);
|
|
320
|
+
await this.checkRoles(user, rolesForAuth, requiredRoles, requiredGuard);
|
|
319
321
|
}
|
|
320
322
|
if (requiredPermissions.length > 0) {
|
|
321
|
-
await this.checkPermissions(user, requiredPermissions);
|
|
323
|
+
await this.checkPermissions(user, rolesForAuth, permissionsForAuth, requiredPermissions);
|
|
322
324
|
}
|
|
323
325
|
}
|
|
324
326
|
getRequiredPermissions(context) {
|
|
325
|
-
|
|
326
|
-
if (!permissions) {
|
|
327
|
+
const permissions = this.reflector.getAllAndOverride(permissions_decorator_1.PERMISSIONS_KEY, [context.getHandler(), context.getClass()]);
|
|
328
|
+
if (!permissions || permissions === undefined || permissions === null) {
|
|
327
329
|
return [];
|
|
328
330
|
}
|
|
329
|
-
|
|
331
|
+
if (typeof permissions === 'string') {
|
|
332
|
+
return permissions.trim() ? [permissions] : [];
|
|
333
|
+
}
|
|
334
|
+
if (Array.isArray(permissions)) {
|
|
335
|
+
return permissions.filter(p => p && typeof p === 'string' && p.trim().length > 0);
|
|
336
|
+
}
|
|
337
|
+
return [];
|
|
330
338
|
}
|
|
331
339
|
getRequiredRoles(context) {
|
|
332
|
-
|
|
333
|
-
if (!roles) {
|
|
340
|
+
const roles = this.reflector.getAllAndOverride(role_decorator_1.ROLES_KEY, [context.getHandler(), context.getClass()]);
|
|
341
|
+
if (!roles || roles === undefined || roles === null) {
|
|
334
342
|
return [];
|
|
335
343
|
}
|
|
336
|
-
|
|
344
|
+
if (typeof roles === 'string') {
|
|
345
|
+
return roles.trim() ? [roles] : [];
|
|
346
|
+
}
|
|
347
|
+
if (Array.isArray(roles)) {
|
|
348
|
+
return roles.filter(r => r && typeof r === 'string' && r.trim().length > 0);
|
|
349
|
+
}
|
|
350
|
+
return [];
|
|
337
351
|
}
|
|
338
352
|
getRequiredGuard(context) {
|
|
339
353
|
return this.reflector.getAllAndOverride(role_decorator_1.GUARD_KEY, [context.getHandler(), context.getClass()]);
|
|
340
354
|
}
|
|
341
|
-
async resolveUserRoles(user) {
|
|
355
|
+
async resolveUserRoles(user, roles) {
|
|
342
356
|
const config = this.authConfigService.getConfig();
|
|
343
357
|
if (config.authorization?.resolveRoles) {
|
|
344
358
|
return await config.authorization.resolveRoles(user);
|
|
345
359
|
}
|
|
346
|
-
if (!
|
|
360
|
+
if (!roles || !Array.isArray(roles)) {
|
|
347
361
|
return [];
|
|
348
362
|
}
|
|
349
|
-
return
|
|
350
|
-
.filter((role) => role
|
|
351
|
-
.map((role) => role
|
|
363
|
+
return roles
|
|
364
|
+
.filter((role) => role?.isActive !== false)
|
|
365
|
+
.map((role) => role?.name)
|
|
366
|
+
.filter((name) => name);
|
|
352
367
|
}
|
|
353
|
-
async checkRoles(user, requiredRoles, requiredGuard) {
|
|
368
|
+
async checkRoles(user, rolesForAuth, requiredRoles, requiredGuard) {
|
|
354
369
|
if (requiredGuard) {
|
|
355
|
-
const userGuards = (0, lodash_1.uniq)(
|
|
356
|
-
|
|
370
|
+
const userGuards = (0, lodash_1.uniq)(rolesForAuth
|
|
371
|
+
.map((role) => role?.guard)
|
|
372
|
+
.filter((guard) => guard));
|
|
373
|
+
if (userGuards.length === 0 || !userGuards.includes(requiredGuard)) {
|
|
357
374
|
throw new common_1.ForbiddenException({
|
|
358
|
-
message: `Access denied: Guard mismatch. Required: ${requiredGuard}, Found: ${userGuards.join(', ')}`,
|
|
375
|
+
message: `Access denied: Guard mismatch. Required: ${requiredGuard}, Found: ${userGuards.length > 0 ? userGuards.join(', ') : 'none'}`,
|
|
359
376
|
code: auth_constants_1.ERROR_CODES.GUARD_MISMATCH,
|
|
360
377
|
});
|
|
361
378
|
}
|
|
362
379
|
}
|
|
363
|
-
const userRoleNames = await this.resolveUserRoles(user);
|
|
364
|
-
if (userRoleNames.length === 0
|
|
380
|
+
const userRoleNames = await this.resolveUserRoles(user, rolesForAuth);
|
|
381
|
+
if (userRoleNames.length === 0) {
|
|
365
382
|
throw new common_1.ForbiddenException({
|
|
366
383
|
message: 'Access denied: No roles assigned',
|
|
367
384
|
code: auth_constants_1.ERROR_CODES.NO_ROLES_ASSIGNED,
|
|
@@ -376,21 +393,26 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
376
393
|
});
|
|
377
394
|
}
|
|
378
395
|
}
|
|
379
|
-
async checkPermissions(user, requiredPermissions) {
|
|
396
|
+
async checkPermissions(user, rolesForAuth, permissionsForAuth, requiredPermissions) {
|
|
380
397
|
const config = this.authConfigService.getConfig();
|
|
381
398
|
let userPermissions = [];
|
|
382
399
|
if (config.authorization?.resolvePermissions) {
|
|
383
|
-
const roles = await this.resolveUserRoles(user);
|
|
400
|
+
const roles = await this.resolveUserRoles(user, rolesForAuth);
|
|
384
401
|
userPermissions = await config.authorization.resolvePermissions(user, roles);
|
|
385
402
|
}
|
|
386
403
|
else {
|
|
387
|
-
if (
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
404
|
+
if (permissionsForAuth && Array.isArray(permissionsForAuth)) {
|
|
405
|
+
userPermissions = permissionsForAuth;
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
if (!rolesForAuth || !Array.isArray(rolesForAuth) || rolesForAuth.length === 0) {
|
|
409
|
+
throw new common_1.ForbiddenException({
|
|
410
|
+
message: 'Access denied: No roles assigned for permission check',
|
|
411
|
+
code: auth_constants_1.ERROR_CODES.NO_ROLES_ASSIGNED,
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
userPermissions = this.getUserPermissions(rolesForAuth);
|
|
392
415
|
}
|
|
393
|
-
userPermissions = this.getUserPermissions(user.roles);
|
|
394
416
|
}
|
|
395
417
|
const hasAllPermissions = requiredPermissions.every(permission => userPermissions.includes(permission));
|
|
396
418
|
if (!hasAllPermissions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.guard.js","sourceRoot":"","sources":["../../../../src/lib/auth/guards/auth.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsH;AACtH,yDAAsE;AACtE,uCAAyC;AAEzC,iEAA6D;AAC7D,4FAAuF;AACvF,+EAA0E;AAE1E,iFAAwE;AACxE,uFAA8E;AAC9E,yEAA4E;AAC5E,iFAA4E;AAC5E,6DAAyD;AACzD,mCAA8B;AAC9B,mFAA8E;AAC9E,6CAAmD;AACnD,qCAAqC;AACrC,iEAA+D;AAiBxD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEd;IACA;IACA;IACA;IACA;IACA;IAES;IARrB,YACY,SAAoB,EACpB,UAAsB,EACtB,cAAqC,EACrC,gBAAkC,EAClC,iBAAoC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GAAG,IAAI,GAAG,EAAU,CAAC;QAEtC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAEjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACjB,OAAO;YACX,CAAC;YAGD,IAAI,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;gBACtD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;YACxE,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ,CAAA;AAtkBY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IASJ,WAAA,IAAA,0BAAgB,EAAC,0BAAY,CAAC,CAAA;qCANZ,gBAAS;QACR,wBAAU;QACN,+CAAqB;QACnB,qCAAgB;QACf,uCAAiB;QACvB,yCAAkB;QAEN,oBAAU;GATtC,iBAAiB,CAskB7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const ROLES_KEY = "nest_auth_roles";
|
|
2
2
|
export declare const GUARD_KEY = "nest_auth_guard";
|
|
3
|
-
export declare
|
|
3
|
+
export declare const NestAuthRoles: (roles: string[] | string, guard?: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
4
4
|
//# sourceMappingURL=role.decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.decorator.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/decorators/role.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"role.decorator.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/decorators/role.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAC3C,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAQ3C,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,GAAG,MAAM,EAAE,QAAQ,MAAM,gJAQrE,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GUARD_KEY = exports.ROLES_KEY = void 0;
|
|
4
|
-
|
|
3
|
+
exports.NestAuthRoles = exports.GUARD_KEY = exports.ROLES_KEY = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
5
|
exports.ROLES_KEY = 'nest_auth_roles';
|
|
6
6
|
exports.GUARD_KEY = 'nest_auth_guard';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const NestAuthRoles = (roles, guard) => {
|
|
8
|
+
if (guard) {
|
|
9
|
+
return (0, common_1.applyDecorators)((0, common_1.SetMetadata)(exports.ROLES_KEY, roles), (0, common_1.SetMetadata)(exports.GUARD_KEY, guard));
|
|
10
|
+
}
|
|
11
|
+
return (0, common_1.SetMetadata)(exports.ROLES_KEY, roles);
|
|
12
|
+
};
|
|
13
|
+
exports.NestAuthRoles = NestAuthRoles;
|
|
14
14
|
//# sourceMappingURL=role.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.decorator.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/role.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"role.decorator.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/role.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA8D;AAEjD,QAAA,SAAS,GAAG,iBAAiB,CAAC;AAC9B,QAAA,SAAS,GAAG,iBAAiB,CAAC;AAQpC,MAAM,aAAa,GAAG,CAAC,KAAwB,EAAE,KAAc,EAAE,EAAE;IACtE,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,IAAA,wBAAe,EAClB,IAAA,oBAAW,EAAC,iBAAS,EAAE,KAAK,CAAC,EAC7B,IAAA,oBAAW,EAAC,iBAAS,EAAE,KAAK,CAAC,CAChC,CAAC;IACN,CAAC;IACD,OAAO,IAAA,oBAAW,EAAC,iBAAS,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC,CAAC;AARW,QAAA,aAAa,iBAQxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ackplus/nest-auth",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.49",
|
|
4
4
|
"description": "Powerful CRUD operations for NestJS with TypeORM - automatic REST endpoints, advanced filtering, relations, pagination, and more",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"qrcode": "^1.5.0",
|
|
40
40
|
"qs": "^6.11.2",
|
|
41
41
|
"speakeasy": "^2.0.0",
|
|
42
|
-
"@ackplus/nest-auth-contracts": "1.1.
|
|
42
|
+
"@ackplus/nest-auth-contracts": "1.1.49"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@nestjs/common": "^10 || ^11",
|