@ackplus/nest-auth 1.1.48 → 1.1.50
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/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 +1 -0
- package/dist/lib/auth/guards/auth.guard.d.ts.map +1 -1
- package/dist/lib/auth/guards/auth.guard.js +85 -83
- package/dist/lib/auth/guards/auth.guard.js.map +1 -1
- package/dist/lib/core/decorators/permissions.decorator.d.ts +1 -1
- package/dist/lib/core/decorators/permissions.decorator.d.ts.map +1 -1
- package/dist/lib/core/decorators/permissions.decorator.js +4 -10
- package/dist/lib/core/decorators/permissions.decorator.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
|
@@ -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.48",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.50",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,{})}));/**
|
|
@@ -18,6 +18,7 @@ export declare class NestAuthAuthGuard implements CanActivate {
|
|
|
18
18
|
constructor(reflector: Reflector, jwtService: JwtService, sessionManager: SessionManagerService, accessKeyService: AccessKeyService, authConfigService: AuthConfigService, debugLogger: DebugLoggerService, userRepository: Repository<NestAuthUser>);
|
|
19
19
|
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
20
20
|
private extractToken;
|
|
21
|
+
private resetAuth;
|
|
21
22
|
private handleJwtAuth;
|
|
22
23
|
private handleApiKeyAuth;
|
|
23
24
|
private checkMfa;
|
|
@@ -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,C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BAPvB,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,OAAO,CAAC,OAAO,CAAC;IA6F9D,OAAO,CAAC,YAAY;IAmCpB,OAAO,CAAC,SAAS;YAOH,aAAa;YAsFb,gBAAgB;YAuDhB,QAAQ;YA4BR,kBAAkB;IA2ChC,OAAO,CAAC,sBAAsB;IA2B9B,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;YAyBhB,UAAU;YAwCV,gBAAgB;IA+C9B,OAAO,CAAC,kBAAkB;CAe7B"}
|
|
@@ -138,6 +138,12 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
138
138
|
this.debugLogger.verbose('No token found in request', 'AuthGuard');
|
|
139
139
|
return { token: null, authType: null };
|
|
140
140
|
}
|
|
141
|
+
resetAuth(request) {
|
|
142
|
+
request.user = null;
|
|
143
|
+
request.session = null;
|
|
144
|
+
request.accessKey = null;
|
|
145
|
+
request.authType = null;
|
|
146
|
+
}
|
|
141
147
|
async handleJwtAuth(context, request, response, token, isOptional = false) {
|
|
142
148
|
try {
|
|
143
149
|
const payload = await this.jwtService.verifyToken(token);
|
|
@@ -147,7 +153,7 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
147
153
|
if (result && result.reject) {
|
|
148
154
|
throw new common_1.UnauthorizedException({
|
|
149
155
|
message: result.reason || 'Authentication rejected by custom guard',
|
|
150
|
-
code: auth_constants_1.ERROR_CODES.ACCESS_DENIED
|
|
156
|
+
code: auth_constants_1.ERROR_CODES.ACCESS_DENIED,
|
|
151
157
|
});
|
|
152
158
|
}
|
|
153
159
|
}
|
|
@@ -156,81 +162,55 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
156
162
|
const session = await this.sessionManager.getSession(payload.sessionId);
|
|
157
163
|
if (!session) {
|
|
158
164
|
if (isOptional) {
|
|
159
|
-
request
|
|
160
|
-
request.authType = null;
|
|
165
|
+
this.resetAuth(request);
|
|
161
166
|
return false;
|
|
162
167
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
});
|
|
168
|
-
}
|
|
168
|
+
throw new common_1.UnauthorizedException({
|
|
169
|
+
message: 'Session not found',
|
|
170
|
+
code: auth_constants_1.ERROR_CODES.SESSION_NOT_FOUND,
|
|
171
|
+
});
|
|
169
172
|
}
|
|
170
173
|
if (config.jwt?.validateToken) {
|
|
171
174
|
const isValid = await config.jwt.validateToken(payload, session);
|
|
172
175
|
if (!isValid) {
|
|
173
|
-
this.debugLogger.warn('validateToken hook returned invalid', 'AuthGuard');
|
|
174
176
|
throw new common_1.UnauthorizedException({
|
|
175
177
|
message: 'Token validation failed',
|
|
176
|
-
code: auth_constants_1.ERROR_CODES.INVALID_TOKEN
|
|
178
|
+
code: auth_constants_1.ERROR_CODES.INVALID_TOKEN,
|
|
177
179
|
});
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
182
|
request.session = session;
|
|
181
183
|
const user = await this.userRepository.findOne({
|
|
182
184
|
where: { id: session.userId },
|
|
183
|
-
select: ['id', 'isActive', 'isVerified']
|
|
185
|
+
select: ['id', 'isActive', 'isVerified'],
|
|
184
186
|
});
|
|
185
|
-
if (!user) {
|
|
186
|
-
this.debugLogger.warn('User not found for session', 'AuthGuard', { userId: session.userId });
|
|
187
|
-
if (isOptional) {
|
|
188
|
-
request.user = null;
|
|
189
|
-
request.authType = null;
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
throw new common_1.UnauthorizedException({
|
|
194
|
-
message: 'User not found',
|
|
195
|
-
code: auth_constants_1.ERROR_CODES.ACCOUNT_INACTIVE
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
if (user.isActive === false) {
|
|
200
|
-
this.debugLogger.warn('User is not active', 'AuthGuard', { userId: user.id });
|
|
187
|
+
if (!user || user.isActive === false) {
|
|
201
188
|
if (isOptional) {
|
|
202
|
-
request
|
|
203
|
-
request.authType = null;
|
|
189
|
+
this.resetAuth(request);
|
|
204
190
|
return false;
|
|
205
191
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
});
|
|
211
|
-
}
|
|
192
|
+
throw new common_1.UnauthorizedException({
|
|
193
|
+
message: !user ? 'User not found' : 'User is not active',
|
|
194
|
+
code: auth_constants_1.ERROR_CODES.ACCOUNT_INACTIVE,
|
|
195
|
+
});
|
|
212
196
|
}
|
|
213
197
|
await this.checkMfa(context, payload, isOptional);
|
|
214
|
-
if (config.guards?.afterAuth) {
|
|
215
|
-
|
|
216
|
-
await config.guards.afterAuth(request, session.data.user, session);
|
|
217
|
-
}
|
|
198
|
+
if (config.guards?.afterAuth && session.data?.user) {
|
|
199
|
+
await config.guards.afterAuth(request, session.data.user, session);
|
|
218
200
|
}
|
|
219
201
|
return true;
|
|
220
202
|
}
|
|
221
203
|
catch (error) {
|
|
222
204
|
if (isOptional) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
else {
|
|
226
|
-
if (error instanceof common_1.UnauthorizedException || error.status) {
|
|
227
|
-
throw error;
|
|
228
|
-
}
|
|
229
|
-
throw new common_1.UnauthorizedException({
|
|
230
|
-
message: 'Invalid or expired token',
|
|
231
|
-
code: auth_constants_1.ERROR_CODES.INVALID_TOKEN
|
|
232
|
-
});
|
|
205
|
+
this.resetAuth(request);
|
|
206
|
+
return false;
|
|
233
207
|
}
|
|
208
|
+
if (error instanceof common_1.UnauthorizedException || error.status)
|
|
209
|
+
throw error;
|
|
210
|
+
throw new common_1.UnauthorizedException({
|
|
211
|
+
message: 'Invalid or expired token',
|
|
212
|
+
code: auth_constants_1.ERROR_CODES.INVALID_TOKEN,
|
|
213
|
+
});
|
|
234
214
|
}
|
|
235
215
|
}
|
|
236
216
|
async handleApiKeyAuth(request, token, isOptional = false) {
|
|
@@ -238,7 +218,7 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
238
218
|
if (!publicKey || !privateKey) {
|
|
239
219
|
this.debugLogger.warn('Invalid API key format', 'AuthGuard');
|
|
240
220
|
if (isOptional) {
|
|
241
|
-
return
|
|
221
|
+
return true;
|
|
242
222
|
}
|
|
243
223
|
else {
|
|
244
224
|
throw new common_1.UnauthorizedException({
|
|
@@ -252,7 +232,7 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
252
232
|
if (!isValid) {
|
|
253
233
|
this.debugLogger.warn('Invalid API key', 'AuthGuard');
|
|
254
234
|
if (isOptional) {
|
|
255
|
-
return
|
|
235
|
+
return true;
|
|
256
236
|
}
|
|
257
237
|
else {
|
|
258
238
|
throw new common_1.UnauthorizedException({
|
|
@@ -271,7 +251,7 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
271
251
|
catch (error) {
|
|
272
252
|
this.debugLogger.logError(error, 'AuthGuard.handleApiKeyAuth');
|
|
273
253
|
if (isOptional) {
|
|
274
|
-
return
|
|
254
|
+
return true;
|
|
275
255
|
}
|
|
276
256
|
else {
|
|
277
257
|
throw error;
|
|
@@ -288,7 +268,7 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
288
268
|
if (isMfaEnabled && !isMfaVerified && !skipMfa) {
|
|
289
269
|
this.debugLogger.warn('MFA verification required but not verified', 'AuthGuard');
|
|
290
270
|
if (isOptional) {
|
|
291
|
-
|
|
271
|
+
return;
|
|
292
272
|
}
|
|
293
273
|
else {
|
|
294
274
|
throw new common_1.UnauthorizedException({
|
|
@@ -307,6 +287,7 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
307
287
|
return;
|
|
308
288
|
}
|
|
309
289
|
const user = request.user;
|
|
290
|
+
const session = request.session;
|
|
310
291
|
if (!user) {
|
|
311
292
|
this.debugLogger.warn('Authorization check failed - no user', 'AuthGuard');
|
|
312
293
|
throw new common_1.ForbiddenException({
|
|
@@ -314,54 +295,71 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
314
295
|
code: auth_constants_1.ERROR_CODES.UNAUTHORIZED,
|
|
315
296
|
});
|
|
316
297
|
}
|
|
298
|
+
const rolesForAuth = session?.data?.roles || user.roles || [];
|
|
299
|
+
const permissionsForAuth = session?.data?.permissions;
|
|
317
300
|
if (requiredRoles.length > 0) {
|
|
318
|
-
await this.checkRoles(user, requiredRoles, requiredGuard);
|
|
301
|
+
await this.checkRoles(user, rolesForAuth, requiredRoles, requiredGuard);
|
|
319
302
|
}
|
|
320
303
|
if (requiredPermissions.length > 0) {
|
|
321
|
-
await this.checkPermissions(user, requiredPermissions);
|
|
304
|
+
await this.checkPermissions(user, rolesForAuth, permissionsForAuth, requiredPermissions);
|
|
322
305
|
}
|
|
323
306
|
}
|
|
324
307
|
getRequiredPermissions(context) {
|
|
325
|
-
|
|
326
|
-
if (!permissions) {
|
|
308
|
+
const permissions = this.reflector.getAllAndOverride(permissions_decorator_1.PERMISSIONS_KEY, [context.getHandler(), context.getClass()]);
|
|
309
|
+
if (!permissions || permissions === undefined || permissions === null) {
|
|
327
310
|
return [];
|
|
328
311
|
}
|
|
329
|
-
|
|
312
|
+
if (typeof permissions === 'string') {
|
|
313
|
+
return permissions.trim() ? [permissions] : [];
|
|
314
|
+
}
|
|
315
|
+
if (Array.isArray(permissions)) {
|
|
316
|
+
return permissions.filter(p => p && typeof p === 'string' && p.trim().length > 0);
|
|
317
|
+
}
|
|
318
|
+
return [];
|
|
330
319
|
}
|
|
331
320
|
getRequiredRoles(context) {
|
|
332
|
-
|
|
333
|
-
if (!roles) {
|
|
321
|
+
const roles = this.reflector.getAllAndOverride(role_decorator_1.ROLES_KEY, [context.getHandler(), context.getClass()]);
|
|
322
|
+
if (!roles || roles === undefined || roles === null) {
|
|
334
323
|
return [];
|
|
335
324
|
}
|
|
336
|
-
|
|
325
|
+
if (typeof roles === 'string') {
|
|
326
|
+
return roles.trim() ? [roles] : [];
|
|
327
|
+
}
|
|
328
|
+
if (Array.isArray(roles)) {
|
|
329
|
+
return roles.filter(r => r && typeof r === 'string' && r.trim().length > 0);
|
|
330
|
+
}
|
|
331
|
+
return [];
|
|
337
332
|
}
|
|
338
333
|
getRequiredGuard(context) {
|
|
339
334
|
return this.reflector.getAllAndOverride(role_decorator_1.GUARD_KEY, [context.getHandler(), context.getClass()]);
|
|
340
335
|
}
|
|
341
|
-
async resolveUserRoles(user) {
|
|
336
|
+
async resolveUserRoles(user, roles) {
|
|
342
337
|
const config = this.authConfigService.getConfig();
|
|
343
338
|
if (config.authorization?.resolveRoles) {
|
|
344
339
|
return await config.authorization.resolveRoles(user);
|
|
345
340
|
}
|
|
346
|
-
if (!
|
|
341
|
+
if (!roles || !Array.isArray(roles)) {
|
|
347
342
|
return [];
|
|
348
343
|
}
|
|
349
|
-
return
|
|
350
|
-
.filter((role) => role
|
|
351
|
-
.map((role) => role
|
|
344
|
+
return roles
|
|
345
|
+
.filter((role) => role?.isActive !== false)
|
|
346
|
+
.map((role) => role?.name)
|
|
347
|
+
.filter((name) => name);
|
|
352
348
|
}
|
|
353
|
-
async checkRoles(user, requiredRoles, requiredGuard) {
|
|
349
|
+
async checkRoles(user, rolesForAuth, requiredRoles, requiredGuard) {
|
|
354
350
|
if (requiredGuard) {
|
|
355
|
-
const userGuards = (0, lodash_1.uniq)(
|
|
356
|
-
|
|
351
|
+
const userGuards = (0, lodash_1.uniq)(rolesForAuth
|
|
352
|
+
.map((role) => role?.guard)
|
|
353
|
+
.filter((guard) => guard));
|
|
354
|
+
if (userGuards.length === 0 || !userGuards.includes(requiredGuard)) {
|
|
357
355
|
throw new common_1.ForbiddenException({
|
|
358
|
-
message: `Access denied: Guard mismatch. Required: ${requiredGuard}, Found: ${userGuards.join(', ')}`,
|
|
356
|
+
message: `Access denied: Guard mismatch. Required: ${requiredGuard}, Found: ${userGuards.length > 0 ? userGuards.join(', ') : 'none'}`,
|
|
359
357
|
code: auth_constants_1.ERROR_CODES.GUARD_MISMATCH,
|
|
360
358
|
});
|
|
361
359
|
}
|
|
362
360
|
}
|
|
363
|
-
const userRoleNames = await this.resolveUserRoles(user);
|
|
364
|
-
if (userRoleNames.length === 0
|
|
361
|
+
const userRoleNames = await this.resolveUserRoles(user, rolesForAuth);
|
|
362
|
+
if (userRoleNames.length === 0) {
|
|
365
363
|
throw new common_1.ForbiddenException({
|
|
366
364
|
message: 'Access denied: No roles assigned',
|
|
367
365
|
code: auth_constants_1.ERROR_CODES.NO_ROLES_ASSIGNED,
|
|
@@ -376,21 +374,26 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
376
374
|
});
|
|
377
375
|
}
|
|
378
376
|
}
|
|
379
|
-
async checkPermissions(user, requiredPermissions) {
|
|
377
|
+
async checkPermissions(user, rolesForAuth, permissionsForAuth, requiredPermissions) {
|
|
380
378
|
const config = this.authConfigService.getConfig();
|
|
381
379
|
let userPermissions = [];
|
|
382
380
|
if (config.authorization?.resolvePermissions) {
|
|
383
|
-
const roles = await this.resolveUserRoles(user);
|
|
381
|
+
const roles = await this.resolveUserRoles(user, rolesForAuth);
|
|
384
382
|
userPermissions = await config.authorization.resolvePermissions(user, roles);
|
|
385
383
|
}
|
|
386
384
|
else {
|
|
387
|
-
if (
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
385
|
+
if (permissionsForAuth && Array.isArray(permissionsForAuth)) {
|
|
386
|
+
userPermissions = permissionsForAuth;
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
if (!rolesForAuth || !Array.isArray(rolesForAuth) || rolesForAuth.length === 0) {
|
|
390
|
+
throw new common_1.ForbiddenException({
|
|
391
|
+
message: 'Access denied: No roles assigned for permission check',
|
|
392
|
+
code: auth_constants_1.ERROR_CODES.NO_ROLES_ASSIGNED,
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
userPermissions = this.getUserPermissions(rolesForAuth);
|
|
392
396
|
}
|
|
393
|
-
userPermissions = this.getUserPermissions(user.roles);
|
|
394
397
|
}
|
|
395
398
|
const hasAllPermissions = requiredPermissions.every(permission => userPermissions.includes(permission));
|
|
396
399
|
if (!hasAllPermissions) {
|
|
@@ -404,9 +407,8 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
404
407
|
getUserPermissions(roles) {
|
|
405
408
|
const permissions = new Set();
|
|
406
409
|
roles.forEach(role => {
|
|
407
|
-
if (
|
|
410
|
+
if (role?.isActive === false)
|
|
408
411
|
return;
|
|
409
|
-
}
|
|
410
412
|
if (role.permissions && Array.isArray(role.permissions)) {
|
|
411
413
|
role.permissions.forEach(permission => permissions.add(permission));
|
|
412
414
|
}
|
|
@@ -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,EACpC,WAA+B,EAEtB,cAAwC;QAPjD,cAAS,GAAT,SAAS,CAAW;QACpB,eAAU,GAAV,UAAU,CAAY;QACtB,mBAAc,GAAd,cAAc,CAAuB;QACrC,qBAAgB,GA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I,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;AArjBY,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,CAqjB7B"}
|
|
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,EACpC,WAA+B,EAEtB,cAAwC;QAPjD,cAAS,GAAT,SAAS,CAAW;QACpB,eAAU,GAAV,UAAU,CAAY;QACtB,mBAAc,GAAd,cAAc,CAAuB;QACrC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,sBAAiB,GAAjB,i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ERMISSIONS_KEY = "nest_auth_permissions";
|
|
2
|
-
export declare
|
|
2
|
+
export declare const NestAuthPermissions: (permissions: string[] | string) => import("@nestjs/common").CustomDecorator<string>;
|
|
3
3
|
//# sourceMappingURL=permissions.decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.decorator.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/decorators/permissions.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"permissions.decorator.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/decorators/permissions.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,0BAA0B,CAAC;AASvD,eAAO,MAAM,mBAAmB,GAAI,aAAa,MAAM,EAAE,GAAG,MAAM,qDACrB,CAAC"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PERMISSIONS_KEY = void 0;
|
|
4
|
-
|
|
3
|
+
exports.NestAuthPermissions = exports.PERMISSIONS_KEY = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
5
|
exports.PERMISSIONS_KEY = 'nest_auth_permissions';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (descriptor) {
|
|
9
|
-
Reflect.defineMetadata(exports.PERMISSIONS_KEY, permissions, descriptor.value);
|
|
10
|
-
}
|
|
11
|
-
return descriptor;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
6
|
+
const NestAuthPermissions = (permissions) => (0, common_1.SetMetadata)(exports.PERMISSIONS_KEY, permissions);
|
|
7
|
+
exports.NestAuthPermissions = NestAuthPermissions;
|
|
14
8
|
//# sourceMappingURL=permissions.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.decorator.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/permissions.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"permissions.decorator.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/permissions.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAEhC,QAAA,eAAe,GAAG,uBAAuB,CAAC;AAShD,MAAM,mBAAmB,GAAG,CAAC,WAA8B,EAAE,EAAE,CAClE,IAAA,oBAAW,EAAC,uBAAe,EAAE,WAAW,CAAC,CAAC;AADjC,QAAA,mBAAmB,uBACc"}
|
|
@@ -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.50",
|
|
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.50"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@nestjs/common": "^10 || ^11",
|