@ackplus/nest-auth 1.1.29 → 1.1.31-beta.10

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.
Files changed (301) hide show
  1. package/README.md +64 -450
  2. package/dist/index.d.ts +4 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/admin-console/admin-console.module.js +1 -1
  7. package/dist/lib/admin-console/admin-console.module.js.map +1 -1
  8. package/dist/lib/admin-console/controllers/admin-auth.controller.d.ts +3 -3
  9. package/dist/lib/admin-console/controllers/admin-auth.controller.d.ts.map +1 -1
  10. package/dist/lib/admin-console/controllers/admin-auth.controller.js +2 -2
  11. package/dist/lib/admin-console/controllers/admin-auth.controller.js.map +1 -1
  12. package/dist/lib/admin-console/controllers/admin-console.controller.js +1 -1
  13. package/dist/lib/admin-console/controllers/admin-console.controller.js.map +1 -1
  14. package/dist/lib/admin-console/controllers/admin-users.controller.d.ts +2 -2
  15. package/dist/lib/admin-console/decorators/current-admin.decorator.js.map +1 -1
  16. package/dist/lib/admin-console/entities/admin-user.entity.d.ts +1 -3
  17. package/dist/lib/admin-console/entities/admin-user.entity.d.ts.map +1 -1
  18. package/dist/lib/admin-console/entities/admin-user.entity.js +19 -66
  19. package/dist/lib/admin-console/entities/admin-user.entity.js.map +1 -1
  20. package/dist/lib/admin-console/guards/admin-session.guard.d.ts +2 -2
  21. package/dist/lib/admin-console/guards/admin-session.guard.d.ts.map +1 -1
  22. package/dist/lib/admin-console/services/admin-auth.service.d.ts +4 -4
  23. package/dist/lib/admin-console/services/admin-auth.service.d.ts.map +1 -1
  24. package/dist/lib/admin-console/services/admin-auth.service.js.map +1 -1
  25. package/dist/lib/admin-console/services/admin-console-config.service.d.ts +4 -4
  26. package/dist/lib/admin-console/services/admin-console-config.service.d.ts.map +1 -1
  27. package/dist/lib/admin-console/services/admin-console-config.service.js +22 -14
  28. package/dist/lib/admin-console/services/admin-console-config.service.js.map +1 -1
  29. package/dist/lib/admin-console/services/admin-session.service.d.ts +2 -2
  30. package/dist/lib/admin-console/services/admin-session.service.d.ts.map +1 -1
  31. package/dist/lib/admin-console/services/admin-session.service.js.map +1 -1
  32. package/dist/lib/admin-console/services/admin-user.service.d.ts +7 -7
  33. package/dist/lib/admin-console/services/admin-user.service.d.ts.map +1 -1
  34. package/dist/lib/admin-console/services/admin-user.service.js +1 -1
  35. package/dist/lib/admin-console/services/admin-user.service.js.map +1 -1
  36. package/dist/lib/admin-console/static/index.html +7433 -0
  37. package/dist/lib/admin-console/static/nest-auth.json +1784 -0
  38. package/dist/lib/audit/services/audit.service.d.ts +6 -1
  39. package/dist/lib/audit/services/audit.service.d.ts.map +1 -1
  40. package/dist/lib/audit/services/audit.service.js +12 -7
  41. package/dist/lib/audit/services/audit.service.js.map +1 -1
  42. package/dist/lib/auth/auth.module.d.ts.map +1 -1
  43. package/dist/lib/auth/auth.module.js +9 -6
  44. package/dist/lib/auth/auth.module.js.map +1 -1
  45. package/dist/lib/auth/controllers/auth.controller.d.ts +37 -45
  46. package/dist/lib/auth/controllers/auth.controller.d.ts.map +1 -1
  47. package/dist/lib/auth/controllers/auth.controller.js +125 -132
  48. package/dist/lib/auth/controllers/auth.controller.js.map +1 -1
  49. package/dist/lib/auth/controllers/mfa.controller.d.ts +9 -15
  50. package/dist/lib/auth/controllers/mfa.controller.d.ts.map +1 -1
  51. package/dist/lib/auth/controllers/mfa.controller.js +23 -20
  52. package/dist/lib/auth/controllers/mfa.controller.js.map +1 -1
  53. package/dist/lib/auth/dto/credentials/social-credentials.dto.d.ts +2 -1
  54. package/dist/lib/auth/dto/credentials/social-credentials.dto.d.ts.map +1 -1
  55. package/dist/lib/auth/dto/credentials/social-credentials.dto.js +9 -2
  56. package/dist/lib/auth/dto/credentials/social-credentials.dto.js.map +1 -1
  57. package/dist/lib/auth/dto/requests/change-password.request.dto.d.ts +2 -1
  58. package/dist/lib/auth/dto/requests/change-password.request.dto.d.ts.map +1 -1
  59. package/dist/lib/auth/dto/requests/change-password.request.dto.js +5 -5
  60. package/dist/lib/auth/dto/requests/change-password.request.dto.js.map +1 -1
  61. package/dist/lib/auth/dto/requests/forgot-password.request.dto.d.ts +2 -1
  62. package/dist/lib/auth/dto/requests/forgot-password.request.dto.d.ts.map +1 -1
  63. package/dist/lib/auth/dto/requests/forgot-password.request.dto.js +6 -6
  64. package/dist/lib/auth/dto/requests/forgot-password.request.dto.js.map +1 -1
  65. package/dist/lib/auth/dto/requests/initialize-admin.request.dto.d.ts +2 -1
  66. package/dist/lib/auth/dto/requests/initialize-admin.request.dto.d.ts.map +1 -1
  67. package/dist/lib/auth/dto/requests/initialize-admin.request.dto.js +8 -8
  68. package/dist/lib/auth/dto/requests/initialize-admin.request.dto.js.map +1 -1
  69. package/dist/lib/auth/dto/requests/login.request.dto.d.ts +3 -2
  70. package/dist/lib/auth/dto/requests/login.request.dto.d.ts.map +1 -1
  71. package/dist/lib/auth/dto/requests/login.request.dto.js +11 -12
  72. package/dist/lib/auth/dto/requests/login.request.dto.js.map +1 -1
  73. package/dist/lib/auth/dto/requests/refresh-token.request.dto.d.ts +2 -1
  74. package/dist/lib/auth/dto/requests/refresh-token.request.dto.d.ts.map +1 -1
  75. package/dist/lib/auth/dto/requests/refresh-token.request.dto.js +4 -4
  76. package/dist/lib/auth/dto/requests/refresh-token.request.dto.js.map +1 -1
  77. package/dist/lib/auth/dto/requests/reset-password-with-token.request.dto.d.ts +2 -1
  78. package/dist/lib/auth/dto/requests/reset-password-with-token.request.dto.d.ts.map +1 -1
  79. package/dist/lib/auth/dto/requests/reset-password-with-token.request.dto.js +5 -5
  80. package/dist/lib/auth/dto/requests/reset-password-with-token.request.dto.js.map +1 -1
  81. package/dist/lib/auth/dto/requests/reset-password.request.dto.d.ts +2 -1
  82. package/dist/lib/auth/dto/requests/reset-password.request.dto.d.ts.map +1 -1
  83. package/dist/lib/auth/dto/requests/reset-password.request.dto.js +8 -8
  84. package/dist/lib/auth/dto/requests/reset-password.request.dto.js.map +1 -1
  85. package/dist/lib/auth/dto/requests/send-email-verification.request.dto.d.ts +2 -1
  86. package/dist/lib/auth/dto/requests/send-email-verification.request.dto.d.ts.map +1 -1
  87. package/dist/lib/auth/dto/requests/send-email-verification.request.dto.js +4 -4
  88. package/dist/lib/auth/dto/requests/send-email-verification.request.dto.js.map +1 -1
  89. package/dist/lib/auth/dto/requests/send-mfa-code.request.dto.d.ts +4 -3
  90. package/dist/lib/auth/dto/requests/send-mfa-code.request.dto.d.ts.map +1 -1
  91. package/dist/lib/auth/dto/requests/send-mfa-code.request.dto.js +12 -12
  92. package/dist/lib/auth/dto/requests/send-mfa-code.request.dto.js.map +1 -1
  93. package/dist/lib/auth/dto/requests/signup.request.dto.d.ts +2 -1
  94. package/dist/lib/auth/dto/requests/signup.request.dto.d.ts.map +1 -1
  95. package/dist/lib/auth/dto/requests/signup.request.dto.js +7 -7
  96. package/dist/lib/auth/dto/requests/signup.request.dto.js.map +1 -1
  97. package/dist/lib/auth/dto/requests/toggle-mfa.request.dto.d.ts +2 -1
  98. package/dist/lib/auth/dto/requests/toggle-mfa.request.dto.d.ts.map +1 -1
  99. package/dist/lib/auth/dto/requests/toggle-mfa.request.dto.js +4 -4
  100. package/dist/lib/auth/dto/requests/toggle-mfa.request.dto.js.map +1 -1
  101. package/dist/lib/auth/dto/requests/verify-2fa.request.dto.d.ts +4 -3
  102. package/dist/lib/auth/dto/requests/verify-2fa.request.dto.d.ts.map +1 -1
  103. package/dist/lib/auth/dto/requests/verify-2fa.request.dto.js +11 -11
  104. package/dist/lib/auth/dto/requests/verify-2fa.request.dto.js.map +1 -1
  105. package/dist/lib/auth/dto/requests/verify-email.request.dto.d.ts +2 -1
  106. package/dist/lib/auth/dto/requests/verify-email.request.dto.d.ts.map +1 -1
  107. package/dist/lib/auth/dto/requests/verify-email.request.dto.js +5 -5
  108. package/dist/lib/auth/dto/requests/verify-email.request.dto.js.map +1 -1
  109. package/dist/lib/auth/dto/requests/verify-forgot-password-otp-request-dto.d.ts +2 -1
  110. package/dist/lib/auth/dto/requests/verify-forgot-password-otp-request-dto.d.ts.map +1 -1
  111. package/dist/lib/auth/dto/requests/verify-forgot-password-otp-request-dto.js +7 -7
  112. package/dist/lib/auth/dto/requests/verify-forgot-password-otp-request-dto.js.map +1 -1
  113. package/dist/lib/auth/dto/requests/verify-totp-setup.request.dto.d.ts +2 -1
  114. package/dist/lib/auth/dto/requests/verify-totp-setup.request.dto.d.ts.map +1 -1
  115. package/dist/lib/auth/dto/requests/verify-totp-setup.request.dto.js +5 -5
  116. package/dist/lib/auth/dto/requests/verify-totp-setup.request.dto.js.map +1 -1
  117. package/dist/lib/auth/dto/responses/auth-cookie.response.dto.d.ts +2 -1
  118. package/dist/lib/auth/dto/responses/auth-cookie.response.dto.d.ts.map +1 -1
  119. package/dist/lib/auth/dto/responses/auth-cookie.response.dto.js.map +1 -1
  120. package/dist/lib/auth/dto/responses/auth-messages.response.dto.d.ts +38 -0
  121. package/dist/lib/auth/dto/responses/auth-messages.response.dto.d.ts.map +1 -0
  122. package/dist/lib/auth/dto/responses/auth-messages.response.dto.js +110 -0
  123. package/dist/lib/auth/dto/responses/auth-messages.response.dto.js.map +1 -0
  124. package/dist/lib/auth/dto/responses/auth-success.response.dto.d.ts +2 -1
  125. package/dist/lib/auth/dto/responses/auth-success.response.dto.d.ts.map +1 -1
  126. package/dist/lib/auth/dto/responses/auth-success.response.dto.js.map +1 -1
  127. package/dist/lib/auth/dto/responses/auth.response.dto.d.ts +7 -4
  128. package/dist/lib/auth/dto/responses/auth.response.dto.d.ts.map +1 -1
  129. package/dist/lib/auth/dto/responses/auth.response.dto.js +20 -0
  130. package/dist/lib/auth/dto/responses/auth.response.dto.js.map +1 -1
  131. package/dist/lib/auth/dto/responses/client-config.response.dto.d.ts +14 -13
  132. package/dist/lib/auth/dto/responses/client-config.response.dto.d.ts.map +1 -1
  133. package/dist/lib/auth/dto/responses/client-config.response.dto.js.map +1 -1
  134. package/dist/lib/auth/dto/responses/initialize-admin.response.dto.d.ts +2 -1
  135. package/dist/lib/auth/dto/responses/initialize-admin.response.dto.d.ts.map +1 -1
  136. package/dist/lib/auth/dto/responses/initialize-admin.response.dto.js.map +1 -1
  137. package/dist/lib/auth/dto/responses/mfa-code-response.dto.d.ts +2 -1
  138. package/dist/lib/auth/dto/responses/mfa-code-response.dto.d.ts.map +1 -1
  139. package/dist/lib/auth/dto/responses/mfa-code-response.dto.js.map +1 -1
  140. package/dist/lib/auth/dto/responses/mfa-status.response.dto.d.ts +7 -6
  141. package/dist/lib/auth/dto/responses/mfa-status.response.dto.d.ts.map +1 -1
  142. package/dist/lib/auth/dto/responses/mfa-status.response.dto.js +7 -7
  143. package/dist/lib/auth/dto/responses/mfa-status.response.dto.js.map +1 -1
  144. package/dist/lib/auth/dto/responses/verify-otp.response.dto.d.ts +2 -1
  145. package/dist/lib/auth/dto/responses/verify-otp.response.dto.d.ts.map +1 -1
  146. package/dist/lib/auth/dto/responses/verify-otp.response.dto.js.map +1 -1
  147. package/dist/lib/auth/entities/otp.entity.d.ts +2 -2
  148. package/dist/lib/auth/entities/otp.entity.d.ts.map +1 -1
  149. package/dist/lib/auth/entities/otp.entity.js +1 -1
  150. package/dist/lib/auth/entities/otp.entity.js.map +1 -1
  151. package/dist/lib/auth/events/password-reset-requested.event.d.ts +2 -2
  152. package/dist/lib/auth/events/password-reset-requested.event.d.ts.map +1 -1
  153. package/dist/lib/auth/events/password-reset.event.d.ts +2 -2
  154. package/dist/lib/auth/events/password-reset.event.d.ts.map +1 -1
  155. package/dist/lib/auth/events/password-reset.event.js.map +1 -1
  156. package/dist/lib/auth/events/two-factor-code-sent.event.d.ts +2 -2
  157. package/dist/lib/auth/events/two-factor-code-sent.event.d.ts.map +1 -1
  158. package/dist/lib/auth/events/user-2fa-enabled.event.d.ts +3 -3
  159. package/dist/lib/auth/events/user-2fa-enabled.event.d.ts.map +1 -1
  160. package/dist/lib/auth/events/user-2fa-verified.event.d.ts +2 -2
  161. package/dist/lib/auth/events/user-2fa-verified.event.d.ts.map +1 -1
  162. package/dist/lib/auth/events/user-logged-in.event.d.ts +2 -2
  163. package/dist/lib/auth/events/user-logged-in.event.d.ts.map +1 -1
  164. package/dist/lib/auth/events/user-registered.event.d.ts +2 -2
  165. package/dist/lib/auth/events/user-registered.event.d.ts.map +1 -1
  166. package/dist/lib/auth/events/user-registered.event.js.map +1 -1
  167. package/dist/lib/auth/filters/auth-exception.filter.d.ts +6 -0
  168. package/dist/lib/auth/filters/auth-exception.filter.d.ts.map +1 -0
  169. package/dist/lib/auth/filters/auth-exception.filter.js +29 -0
  170. package/dist/lib/auth/filters/auth-exception.filter.js.map +1 -0
  171. package/dist/lib/auth/filters/index.d.ts +2 -0
  172. package/dist/lib/auth/filters/index.d.ts.map +1 -0
  173. package/dist/lib/auth/filters/index.js +18 -0
  174. package/dist/lib/auth/filters/index.js.map +1 -0
  175. package/dist/lib/auth/index.d.ts +1 -2
  176. package/dist/lib/auth/index.d.ts.map +1 -1
  177. package/dist/lib/auth/index.js +1 -2
  178. package/dist/lib/auth/index.js.map +1 -1
  179. package/dist/lib/auth/interceptors/token-response.interceptor.d.ts +16 -0
  180. package/dist/lib/auth/interceptors/token-response.interceptor.d.ts.map +1 -0
  181. package/dist/lib/auth/interceptors/token-response.interceptor.js +83 -0
  182. package/dist/lib/auth/interceptors/token-response.interceptor.js.map +1 -0
  183. package/dist/lib/auth/services/auth.service.d.ts +11 -33
  184. package/dist/lib/auth/services/auth.service.d.ts.map +1 -1
  185. package/dist/lib/auth/services/auth.service.js +65 -505
  186. package/dist/lib/auth/services/auth.service.js.map +1 -1
  187. package/dist/lib/auth/services/client-config.service.d.ts.map +1 -1
  188. package/dist/lib/auth/services/client-config.service.js +2 -4
  189. package/dist/lib/auth/services/client-config.service.js.map +1 -1
  190. package/dist/lib/auth/services/mfa.service.d.ts +8 -7
  191. package/dist/lib/auth/services/mfa.service.d.ts.map +1 -1
  192. package/dist/lib/auth/services/mfa.service.js +21 -21
  193. package/dist/lib/auth/services/mfa.service.js.map +1 -1
  194. package/dist/lib/auth/services/password.service.d.ts +44 -0
  195. package/dist/lib/auth/services/password.service.d.ts.map +1 -0
  196. package/dist/lib/auth/services/password.service.js +447 -0
  197. package/dist/lib/auth/services/password.service.js.map +1 -0
  198. package/dist/lib/auth/services/verification.service.d.ts +24 -0
  199. package/dist/lib/auth/services/verification.service.d.ts.map +1 -0
  200. package/dist/lib/auth/services/verification.service.js +191 -0
  201. package/dist/lib/auth/services/verification.service.js.map +1 -0
  202. package/dist/lib/auth.constants.d.ts +0 -8
  203. package/dist/lib/auth.constants.d.ts.map +1 -1
  204. package/dist/lib/auth.constants.js +1 -9
  205. package/dist/lib/auth.constants.js.map +1 -1
  206. package/dist/lib/core/core.module.d.ts.map +1 -1
  207. package/dist/lib/core/core.module.js +3 -0
  208. package/dist/lib/core/core.module.js.map +1 -1
  209. package/dist/lib/core/entities.d.ts +2 -3
  210. package/dist/lib/core/entities.d.ts.map +1 -1
  211. package/dist/lib/core/entities.js +2 -4
  212. package/dist/lib/core/entities.js.map +1 -1
  213. package/dist/lib/core/index.d.ts +0 -5
  214. package/dist/lib/core/index.d.ts.map +1 -1
  215. package/dist/lib/core/index.js +0 -5
  216. package/dist/lib/core/index.js.map +1 -1
  217. package/dist/lib/core/interfaces/auth-module-options.interface.d.ts +31 -32
  218. package/dist/lib/core/interfaces/auth-module-options.interface.d.ts.map +1 -1
  219. package/dist/lib/core/interfaces/mfa-options.interface.d.ts +3 -6
  220. package/dist/lib/core/interfaces/mfa-options.interface.d.ts.map +1 -1
  221. package/dist/lib/core/interfaces/mfa-options.interface.js +0 -7
  222. package/dist/lib/core/interfaces/mfa-options.interface.js.map +1 -1
  223. package/dist/lib/core/interfaces/session-options.interface.d.ts.map +1 -1
  224. package/dist/lib/core/providers/apple-auth.provider.d.ts +6 -3
  225. package/dist/lib/core/providers/apple-auth.provider.d.ts.map +1 -1
  226. package/dist/lib/core/providers/apple-auth.provider.js +14 -7
  227. package/dist/lib/core/providers/apple-auth.provider.js.map +1 -1
  228. package/dist/lib/core/providers/base-auth.provider.d.ts +4 -3
  229. package/dist/lib/core/providers/base-auth.provider.d.ts.map +1 -1
  230. package/dist/lib/core/providers/base-auth.provider.js.map +1 -1
  231. package/dist/lib/core/providers/email-auth.provider.d.ts +7 -7
  232. package/dist/lib/core/providers/email-auth.provider.d.ts.map +1 -1
  233. package/dist/lib/core/providers/email-auth.provider.js +19 -8
  234. package/dist/lib/core/providers/email-auth.provider.js.map +1 -1
  235. package/dist/lib/core/providers/facebook-auth.provider.d.ts +8 -6
  236. package/dist/lib/core/providers/facebook-auth.provider.d.ts.map +1 -1
  237. package/dist/lib/core/providers/facebook-auth.provider.js +31 -18
  238. package/dist/lib/core/providers/facebook-auth.provider.js.map +1 -1
  239. package/dist/lib/core/providers/github-auth.provider.d.ts +8 -6
  240. package/dist/lib/core/providers/github-auth.provider.d.ts.map +1 -1
  241. package/dist/lib/core/providers/github-auth.provider.js +18 -11
  242. package/dist/lib/core/providers/github-auth.provider.js.map +1 -1
  243. package/dist/lib/core/providers/google-auth.provider.d.ts +14 -13
  244. package/dist/lib/core/providers/google-auth.provider.d.ts.map +1 -1
  245. package/dist/lib/core/providers/google-auth.provider.js +36 -18
  246. package/dist/lib/core/providers/google-auth.provider.js.map +1 -1
  247. package/dist/lib/core/providers/jwt-auth.provider.d.ts +8 -6
  248. package/dist/lib/core/providers/jwt-auth.provider.d.ts.map +1 -1
  249. package/dist/lib/core/providers/jwt-auth.provider.js +17 -11
  250. package/dist/lib/core/providers/jwt-auth.provider.js.map +1 -1
  251. package/dist/lib/core/providers/phone-auth.provider.d.ts +7 -7
  252. package/dist/lib/core/providers/phone-auth.provider.d.ts.map +1 -1
  253. package/dist/lib/core/providers/phone-auth.provider.js +14 -7
  254. package/dist/lib/core/providers/phone-auth.provider.js.map +1 -1
  255. package/dist/lib/core/services/auth-config.service.d.ts +9 -9
  256. package/dist/lib/core/services/auth-config.service.d.ts.map +1 -1
  257. package/dist/lib/core/services/auth-config.service.js +22 -20
  258. package/dist/lib/core/services/auth-config.service.js.map +1 -1
  259. package/dist/lib/core/services/auth-provider-registry.service.d.ts.map +1 -1
  260. package/dist/lib/core/services/auth-provider-registry.service.js +5 -0
  261. package/dist/lib/core/services/auth-provider-registry.service.js.map +1 -1
  262. package/dist/lib/core/services/jwt.service.d.ts +3 -3
  263. package/dist/lib/core/services/jwt.service.d.ts.map +1 -1
  264. package/dist/lib/core/services/jwt.service.js +41 -8
  265. package/dist/lib/core/services/jwt.service.js.map +1 -1
  266. package/dist/lib/nest-auth.module.d.ts +3 -3
  267. package/dist/lib/nest-auth.module.d.ts.map +1 -1
  268. package/dist/lib/nest-auth.module.js +5 -16
  269. package/dist/lib/nest-auth.module.js.map +1 -1
  270. package/dist/lib/session/services/session-manager.service.js.map +1 -1
  271. package/dist/lib/tenant/services/tenant.service.d.ts +0 -1
  272. package/dist/lib/tenant/services/tenant.service.d.ts.map +1 -1
  273. package/dist/lib/tenant/services/tenant.service.js +8 -25
  274. package/dist/lib/tenant/services/tenant.service.js.map +1 -1
  275. package/dist/lib/user/entities/user.entity.d.ts +0 -2
  276. package/dist/lib/user/entities/user.entity.d.ts.map +1 -1
  277. package/dist/lib/user/entities/user.entity.js +5 -52
  278. package/dist/lib/user/entities/user.entity.js.map +1 -1
  279. package/dist/lib/user/services/user.service.d.ts.map +1 -1
  280. package/dist/lib/user/services/user.service.js.map +1 -1
  281. package/package.json +53 -45
  282. package/dist/lib/auth/dto/index.d.ts +0 -1
  283. package/dist/lib/auth/dto/index.d.ts.map +0 -1
  284. package/dist/lib/auth/dto/index.js +0 -1
  285. package/dist/lib/auth/dto/index.js.map +0 -1
  286. package/dist/lib/auth/events/index.d.ts +0 -13
  287. package/dist/lib/auth/events/index.d.ts.map +0 -1
  288. package/dist/lib/auth/events/index.js +0 -29
  289. package/dist/lib/auth/events/index.js.map +0 -1
  290. package/dist/lib/auth/interceptors/refresh-token.interceptor.d.ts +0 -16
  291. package/dist/lib/auth/interceptors/refresh-token.interceptor.d.ts.map +0 -1
  292. package/dist/lib/auth/interceptors/refresh-token.interceptor.js +0 -87
  293. package/dist/lib/auth/interceptors/refresh-token.interceptor.js.map +0 -1
  294. package/dist/lib/auth/services/cookie.service.d.ts +0 -10
  295. package/dist/lib/auth/services/cookie.service.d.ts.map +0 -1
  296. package/dist/lib/auth/services/cookie.service.js +0 -55
  297. package/dist/lib/auth/services/cookie.service.js.map +0 -1
  298. package/dist/lib/core/interfaces/otp.interface.d.ts +0 -6
  299. package/dist/lib/core/interfaces/otp.interface.d.ts.map +0 -1
  300. package/dist/lib/core/interfaces/otp.interface.js +0 -10
  301. package/dist/lib/core/interfaces/otp.interface.js.map +0 -1
@@ -0,0 +1,1784 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "paths": {
4
+ "/auth/signup": {
5
+ "post": {
6
+ "description": "Register a new user. Response format depends on accessTokenType configuration:\n- Header mode (default): Returns tokens in response body\n- Cookie mode: Sets tokens in HTTP-only cookies and returns success message",
7
+ "operationId": "AuthController_signup",
8
+ "parameters": [],
9
+ "requestBody": {
10
+ "required": true,
11
+ "content": {
12
+ "application/json": {
13
+ "schema": {
14
+ "$ref": "#/components/schemas/NestAuthSignupRequestDto"
15
+ }
16
+ }
17
+ }
18
+ },
19
+ "responses": {
20
+ "200": {
21
+ "description": "Header mode: Returns message + tokens in body",
22
+ "content": {
23
+ "application/json": {
24
+ "schema": {
25
+ "$ref": "#/components/schemas/AuthWithTokensResponseDto"
26
+ }
27
+ }
28
+ }
29
+ }
30
+ },
31
+ "summary": "Signup",
32
+ "tags": [
33
+ "Auth"
34
+ ]
35
+ }
36
+ },
37
+ "/auth/login": {
38
+ "post": {
39
+ "description": "Authenticate user. Response format depends on accessTokenType configuration:\n- Header mode (default): Returns tokens in response body\n- Cookie mode: Sets tokens in HTTP-only cookies and returns success message",
40
+ "operationId": "AuthController_login",
41
+ "parameters": [],
42
+ "requestBody": {
43
+ "required": true,
44
+ "content": {
45
+ "application/json": {
46
+ "schema": {
47
+ "$ref": "#/components/schemas/NestAuthLoginRequestDto"
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "responses": {
53
+ "200": {
54
+ "description": "Header mode: Returns message + tokens in body",
55
+ "content": {
56
+ "application/json": {
57
+ "schema": {
58
+ "$ref": "#/components/schemas/AuthWithTokensResponseDto"
59
+ }
60
+ }
61
+ }
62
+ }
63
+ },
64
+ "summary": "Login",
65
+ "tags": [
66
+ "Auth"
67
+ ]
68
+ }
69
+ },
70
+ "/auth/refresh-token": {
71
+ "post": {
72
+ "description": "Refresh access token. Response format depends on accessTokenType configuration:\n- Header mode (default): Returns new tokens in response body\n- Cookie mode: Sets new tokens in HTTP-only cookies and returns success message",
73
+ "operationId": "AuthController_refreshToken",
74
+ "parameters": [],
75
+ "requestBody": {
76
+ "required": true,
77
+ "content": {
78
+ "application/json": {
79
+ "schema": {
80
+ "$ref": "#/components/schemas/NestAuthRefreshTokenRequestDto"
81
+ }
82
+ }
83
+ }
84
+ },
85
+ "responses": {
86
+ "200": {
87
+ "description": "Header mode: Returns message + tokens in body",
88
+ "content": {
89
+ "application/json": {
90
+ "schema": {
91
+ "$ref": "#/components/schemas/AuthWithTokensResponseDto"
92
+ }
93
+ }
94
+ }
95
+ }
96
+ },
97
+ "summary": "Refresh Token",
98
+ "tags": [
99
+ "Auth"
100
+ ]
101
+ }
102
+ },
103
+ "/auth/mfa/challenge": {
104
+ "post": {
105
+ "operationId": "MfaController_challenge",
106
+ "parameters": [],
107
+ "requestBody": {
108
+ "required": true,
109
+ "content": {
110
+ "application/json": {
111
+ "schema": {
112
+ "$ref": "#/components/schemas/NestAuthSendMfaCodeRequestDto"
113
+ }
114
+ }
115
+ }
116
+ },
117
+ "responses": {
118
+ "200": {
119
+ "description": "",
120
+ "content": {
121
+ "application/json": {
122
+ "schema": {
123
+ "$ref": "#/components/schemas/NestAuthMfaCodeSentResponseDto"
124
+ }
125
+ }
126
+ }
127
+ }
128
+ },
129
+ "summary": "Send MFA code for setup/verification",
130
+ "tags": [
131
+ "Mfa"
132
+ ]
133
+ }
134
+ },
135
+ "/auth/mfa/verify": {
136
+ "post": {
137
+ "description": "Verify multi-factor authentication. Response format depends on accessTokenType configuration:\n- Header mode (default): Returns tokens in response body\n- Cookie mode: Sets tokens in HTTP-only cookies and returns success message",
138
+ "operationId": "AuthController_verify2fa",
139
+ "parameters": [],
140
+ "requestBody": {
141
+ "required": true,
142
+ "content": {
143
+ "application/json": {
144
+ "schema": {
145
+ "$ref": "#/components/schemas/NestAuthVerify2faRequestDto"
146
+ }
147
+ }
148
+ }
149
+ },
150
+ "responses": {
151
+ "200": {
152
+ "description": "Header mode: Returns message + tokens in body",
153
+ "content": {
154
+ "application/json": {
155
+ "schema": {
156
+ "$ref": "#/components/schemas/Verify2faWithTokensResponseDto"
157
+ }
158
+ }
159
+ }
160
+ }
161
+ },
162
+ "summary": "Verify MFA",
163
+ "tags": [
164
+ "Auth"
165
+ ]
166
+ }
167
+ },
168
+ "/auth/logout": {
169
+ "post": {
170
+ "operationId": "AuthController_logout",
171
+ "parameters": [],
172
+ "responses": {
173
+ "200": {
174
+ "description": "",
175
+ "content": {
176
+ "application/json": {
177
+ "schema": {
178
+ "$ref": "#/components/schemas/NestAuthLogoutResponseDto"
179
+ }
180
+ }
181
+ }
182
+ }
183
+ },
184
+ "summary": "Logout",
185
+ "tags": [
186
+ "Auth"
187
+ ]
188
+ }
189
+ },
190
+ "/auth/logout-all": {
191
+ "post": {
192
+ "operationId": "AuthController_logoutAll",
193
+ "parameters": [],
194
+ "responses": {
195
+ "200": {
196
+ "description": "",
197
+ "content": {
198
+ "application/json": {
199
+ "schema": {
200
+ "$ref": "#/components/schemas/NestAuthLogoutAllResponseDto"
201
+ }
202
+ }
203
+ }
204
+ }
205
+ },
206
+ "summary": "Logout All",
207
+ "tags": [
208
+ "Auth"
209
+ ]
210
+ }
211
+ },
212
+ "/auth/change-password": {
213
+ "post": {
214
+ "operationId": "AuthController_changePassword",
215
+ "parameters": [],
216
+ "requestBody": {
217
+ "required": true,
218
+ "content": {
219
+ "application/json": {
220
+ "schema": {
221
+ "$ref": "#/components/schemas/NestAuthChangePasswordRequestDto"
222
+ }
223
+ }
224
+ }
225
+ },
226
+ "responses": {
227
+ "200": {
228
+ "description": "",
229
+ "content": {
230
+ "application/json": {
231
+ "schema": {
232
+ "$ref": "#/components/schemas/AuthWithTokensResponseDto"
233
+ }
234
+ }
235
+ }
236
+ }
237
+ },
238
+ "summary": "Change Password",
239
+ "tags": [
240
+ "Auth"
241
+ ]
242
+ }
243
+ },
244
+ "/auth/forgot-password": {
245
+ "post": {
246
+ "operationId": "AuthController_forgotPassword",
247
+ "parameters": [],
248
+ "requestBody": {
249
+ "required": true,
250
+ "content": {
251
+ "application/json": {
252
+ "schema": {
253
+ "$ref": "#/components/schemas/NestAuthForgotPasswordRequestDto"
254
+ }
255
+ }
256
+ }
257
+ },
258
+ "responses": {
259
+ "200": {
260
+ "description": "",
261
+ "content": {
262
+ "application/json": {
263
+ "schema": {
264
+ "$ref": "#/components/schemas/NestAuthPasswordResetLinkSentResponseDto"
265
+ }
266
+ }
267
+ }
268
+ }
269
+ },
270
+ "summary": "Forgot password",
271
+ "tags": [
272
+ "Auth"
273
+ ]
274
+ }
275
+ },
276
+ "/auth/verify-forgot-password-otp": {
277
+ "post": {
278
+ "operationId": "AuthController_verifyForgotPasswordOtp",
279
+ "parameters": [],
280
+ "requestBody": {
281
+ "required": true,
282
+ "content": {
283
+ "application/json": {
284
+ "schema": {
285
+ "$ref": "#/components/schemas/NestAuthVerifyForgotPasswordOtpRequestDto"
286
+ }
287
+ }
288
+ }
289
+ },
290
+ "responses": {
291
+ "200": {
292
+ "description": "",
293
+ "content": {
294
+ "application/json": {
295
+ "schema": {
296
+ "$ref": "#/components/schemas/VerifyOtpResponseDto"
297
+ }
298
+ }
299
+ }
300
+ }
301
+ },
302
+ "summary": "Verify Forgot Password OTP and get reset token",
303
+ "tags": [
304
+ "Auth"
305
+ ]
306
+ }
307
+ },
308
+ "/auth/reset-password": {
309
+ "post": {
310
+ "operationId": "AuthController_resetPassword",
311
+ "parameters": [],
312
+ "requestBody": {
313
+ "required": true,
314
+ "content": {
315
+ "application/json": {
316
+ "schema": {
317
+ "$ref": "#/components/schemas/NestAuthResetPasswordWithTokenRequestDto"
318
+ }
319
+ }
320
+ }
321
+ },
322
+ "responses": {
323
+ "200": {
324
+ "description": "",
325
+ "content": {
326
+ "application/json": {
327
+ "schema": {
328
+ "$ref": "#/components/schemas/NestAuthPasswordResetResponseDto"
329
+ }
330
+ }
331
+ }
332
+ }
333
+ },
334
+ "summary": "Reset password",
335
+ "tags": [
336
+ "Auth"
337
+ ]
338
+ }
339
+ },
340
+ "/auth/user": {
341
+ "get": {
342
+ "operationId": "AuthController_getUser",
343
+ "parameters": [],
344
+ "responses": {
345
+ "200": {
346
+ "description": "",
347
+ "content": {
348
+ "application/json": {
349
+ "schema": {
350
+ "$ref": "#/components/schemas/UserResponseDto"
351
+ }
352
+ }
353
+ }
354
+ }
355
+ },
356
+ "summary": "Get Logged In User",
357
+ "tags": [
358
+ "Auth"
359
+ ]
360
+ }
361
+ },
362
+ "/auth/verify-session": {
363
+ "get": {
364
+ "description": "Lightweight endpoint to verify if the current session is valid. Returns minimal information without fetching full user data.",
365
+ "operationId": "AuthController_verifySession",
366
+ "parameters": [],
367
+ "responses": {
368
+ "200": {
369
+ "description": "",
370
+ "content": {
371
+ "application/json": {
372
+ "schema": {
373
+ "properties": {
374
+ "valid": {
375
+ "type": "boolean",
376
+ "example": true
377
+ },
378
+ "userId": {
379
+ "type": "string",
380
+ "example": "123e4567-e89b-12d3-a456-426614174000"
381
+ },
382
+ "expiresAt": {
383
+ "type": "string",
384
+ "example": "2024-01-01T12:00:00.000Z"
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+ }
391
+ },
392
+ "summary": "Verify Session",
393
+ "tags": [
394
+ "Auth"
395
+ ]
396
+ }
397
+ },
398
+ "/auth/send-email-verification": {
399
+ "post": {
400
+ "operationId": "AuthController_sendEmailVerification",
401
+ "parameters": [],
402
+ "requestBody": {
403
+ "required": true,
404
+ "content": {
405
+ "application/json": {
406
+ "schema": {
407
+ "$ref": "#/components/schemas/NestAuthSendEmailVerificationRequestDto"
408
+ }
409
+ }
410
+ }
411
+ },
412
+ "responses": {
413
+ "200": {
414
+ "description": "",
415
+ "content": {
416
+ "application/json": {
417
+ "schema": {
418
+ "$ref": "#/components/schemas/NestAuthEmailVerificationSentResponseDto"
419
+ }
420
+ }
421
+ }
422
+ }
423
+ },
424
+ "summary": "Send email verification",
425
+ "tags": [
426
+ "Auth"
427
+ ]
428
+ }
429
+ },
430
+ "/auth/verify-email": {
431
+ "post": {
432
+ "operationId": "AuthController_verifyEmail",
433
+ "parameters": [],
434
+ "requestBody": {
435
+ "required": true,
436
+ "content": {
437
+ "application/json": {
438
+ "schema": {
439
+ "$ref": "#/components/schemas/NestAuthVerifyEmailRequestDto"
440
+ }
441
+ }
442
+ }
443
+ },
444
+ "responses": {
445
+ "200": {
446
+ "description": "",
447
+ "content": {
448
+ "application/json": {
449
+ "schema": {
450
+ "$ref": "#/components/schemas/NestAuthEmailVerifiedResponseDto"
451
+ }
452
+ }
453
+ }
454
+ }
455
+ },
456
+ "summary": "Verify Email",
457
+ "tags": [
458
+ "Auth"
459
+ ]
460
+ }
461
+ },
462
+ "/auth/client-config": {
463
+ "get": {
464
+ "description": "Returns backend configuration for frontend clients. Includes enabled auth methods, registration settings, MFA options, tenant configuration, and SSO providers. Can be customized via clientConfig.factory in AuthModuleOptions.",
465
+ "operationId": "AuthController_getClientConfig",
466
+ "parameters": [],
467
+ "responses": {
468
+ "200": {
469
+ "description": "",
470
+ "content": {
471
+ "application/json": {
472
+ "schema": {
473
+ "$ref": "#/components/schemas/ClientConfigResponseDto"
474
+ }
475
+ }
476
+ }
477
+ }
478
+ },
479
+ "summary": "Get Client Configuration",
480
+ "tags": [
481
+ "Auth"
482
+ ]
483
+ }
484
+ },
485
+ "/auth/callback/{provider}": {
486
+ "get": {
487
+ "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.",
488
+ "operationId": "AuthController_ssoCallback",
489
+ "parameters": [
490
+ {
491
+ "name": "provider",
492
+ "required": true,
493
+ "in": "path",
494
+ "schema": {
495
+ "type": "string"
496
+ }
497
+ }
498
+ ],
499
+ "responses": {
500
+ "200": {
501
+ "description": ""
502
+ }
503
+ },
504
+ "summary": "SSO Callback",
505
+ "tags": [
506
+ "Auth"
507
+ ]
508
+ }
509
+ },
510
+ "/auth/mfa/status": {
511
+ "get": {
512
+ "operationId": "MfaController_getStatus",
513
+ "parameters": [],
514
+ "responses": {
515
+ "200": {
516
+ "description": "",
517
+ "content": {
518
+ "application/json": {
519
+ "schema": {
520
+ "$ref": "#/components/schemas/MfaStatusResponseDto"
521
+ }
522
+ }
523
+ }
524
+ }
525
+ },
526
+ "summary": "Get MFA status for the current user",
527
+ "tags": [
528
+ "Mfa"
529
+ ]
530
+ }
531
+ },
532
+ "/auth/mfa/toggle": {
533
+ "post": {
534
+ "operationId": "MfaController_toggleMfa",
535
+ "parameters": [],
536
+ "requestBody": {
537
+ "required": true,
538
+ "content": {
539
+ "application/json": {
540
+ "schema": {
541
+ "$ref": "#/components/schemas/NestAuthToggleMfaRequestDto"
542
+ }
543
+ }
544
+ }
545
+ },
546
+ "responses": {
547
+ "200": {
548
+ "description": "",
549
+ "content": {
550
+ "application/json": {
551
+ "schema": {
552
+ "$ref": "#/components/schemas/NestAuthMfaToggleResponseDto"
553
+ }
554
+ }
555
+ }
556
+ }
557
+ },
558
+ "summary": "Enable or disable MFA for the current user",
559
+ "tags": [
560
+ "Mfa"
561
+ ]
562
+ }
563
+ },
564
+ "/auth/mfa/devices": {
565
+ "get": {
566
+ "operationId": "MfaController_listDevices",
567
+ "parameters": [],
568
+ "responses": {
569
+ "200": {
570
+ "description": "",
571
+ "content": {
572
+ "application/json": {
573
+ "schema": {
574
+ "type": "array",
575
+ "items": {
576
+ "$ref": "#/components/schemas/MfaDeviceDto"
577
+ }
578
+ }
579
+ }
580
+ }
581
+ }
582
+ },
583
+ "summary": "List registered MFA devices",
584
+ "tags": [
585
+ "Mfa"
586
+ ]
587
+ }
588
+ },
589
+ "/auth/mfa/devices/{deviceId}": {
590
+ "delete": {
591
+ "operationId": "MfaController_removeDevice",
592
+ "parameters": [
593
+ {
594
+ "name": "deviceId",
595
+ "required": true,
596
+ "in": "path",
597
+ "schema": {
598
+ "type": "string"
599
+ }
600
+ }
601
+ ],
602
+ "responses": {
603
+ "200": {
604
+ "description": "",
605
+ "content": {
606
+ "application/json": {
607
+ "schema": {
608
+ "$ref": "#/components/schemas/NestAuthMfaDeviceRemovedResponseDto"
609
+ }
610
+ }
611
+ }
612
+ }
613
+ },
614
+ "summary": "Remove a registered MFA device",
615
+ "tags": [
616
+ "Mfa"
617
+ ]
618
+ }
619
+ },
620
+ "/auth/mfa/setup-totp": {
621
+ "post": {
622
+ "operationId": "MfaController_setupTotp",
623
+ "parameters": [],
624
+ "responses": {
625
+ "200": {
626
+ "description": ""
627
+ }
628
+ },
629
+ "summary": "Setup TOTP Device",
630
+ "tags": [
631
+ "Mfa"
632
+ ]
633
+ }
634
+ },
635
+ "/auth/mfa/verify-totp-setup": {
636
+ "post": {
637
+ "operationId": "MfaController_verifyTotpSetup",
638
+ "parameters": [],
639
+ "requestBody": {
640
+ "required": true,
641
+ "content": {
642
+ "application/json": {
643
+ "schema": {
644
+ "$ref": "#/components/schemas/NestAuthVerifyTotpSetupRequestDto"
645
+ }
646
+ }
647
+ }
648
+ },
649
+ "responses": {
650
+ "200": {
651
+ "description": "",
652
+ "content": {
653
+ "application/json": {
654
+ "schema": {
655
+ "$ref": "#/components/schemas/NestAuthMfaDeviceVerifiedResponseDto"
656
+ }
657
+ }
658
+ }
659
+ }
660
+ },
661
+ "summary": "Verify TOTP Setup",
662
+ "tags": [
663
+ "Mfa"
664
+ ]
665
+ }
666
+ },
667
+ "/auth/mfa/generate-recovery-code": {
668
+ "post": {
669
+ "operationId": "MfaController_generateRecoveryCodes",
670
+ "parameters": [],
671
+ "responses": {
672
+ "200": {
673
+ "description": ""
674
+ }
675
+ },
676
+ "summary": "Generate Recovery Codes",
677
+ "tags": [
678
+ "Mfa"
679
+ ]
680
+ }
681
+ },
682
+ "/auth/mfa/reset-totp": {
683
+ "post": {
684
+ "operationId": "MfaController_resetTotp",
685
+ "parameters": [],
686
+ "responses": {
687
+ "200": {
688
+ "description": "",
689
+ "content": {
690
+ "application/json": {
691
+ "schema": {
692
+ "$ref": "#/components/schemas/NestAuthMfaResetResponseDto"
693
+ }
694
+ }
695
+ }
696
+ }
697
+ },
698
+ "summary": "Reset TOTP Device",
699
+ "tags": [
700
+ "Mfa"
701
+ ]
702
+ }
703
+ }
704
+ },
705
+ "info": {
706
+ "title": "@ackplus/nest-auth API",
707
+ "description": "OpenAPI specification generated from the Nest Auth module",
708
+ "version": "1.1.31-beta.10",
709
+ "contact": {}
710
+ },
711
+ "tags": [],
712
+ "servers": [],
713
+ "components": {
714
+ "securitySchemes": {
715
+ "bearer": {
716
+ "scheme": "bearer",
717
+ "bearerFormat": "JWT",
718
+ "type": "http"
719
+ }
720
+ },
721
+ "schemas": {
722
+ "NestAuthSignupRequestDto": {
723
+ "type": "object",
724
+ "properties": {
725
+ "email": {
726
+ "type": "string",
727
+ "description": "User email address (required if phone not provided)",
728
+ "example": "user@example.com"
729
+ },
730
+ "phone": {
731
+ "type": "string",
732
+ "description": "User phone number (required if email not provided)",
733
+ "example": "+1234567890"
734
+ },
735
+ "password": {
736
+ "type": "string",
737
+ "description": "User password",
738
+ "example": "SecurePass123!",
739
+ "minLength": 8
740
+ },
741
+ "tenantId": {
742
+ "type": "string",
743
+ "description": "Tenant ID for multi-tenant applications",
744
+ "example": "123e4567-e89b-12d3-a456-426614174000"
745
+ }
746
+ },
747
+ "required": [
748
+ "password"
749
+ ]
750
+ },
751
+ "UserResponseDto": {
752
+ "type": "object",
753
+ "properties": {
754
+ "id": {
755
+ "type": "string",
756
+ "description": "User unique identifier",
757
+ "example": "123e4567-e89b-12d3-a456-426614174000"
758
+ },
759
+ "email": {
760
+ "type": "string",
761
+ "description": "User email address",
762
+ "example": "user@example.com"
763
+ },
764
+ "phone": {
765
+ "type": "string",
766
+ "description": "User phone number",
767
+ "example": "+1234567890"
768
+ },
769
+ "isVerified": {
770
+ "type": "boolean",
771
+ "description": "Email verification status",
772
+ "example": true
773
+ },
774
+ "metadata": {
775
+ "type": "object",
776
+ "description": "Additional user metadata",
777
+ "example": {
778
+ "firstName": "John",
779
+ "lastName": "Doe"
780
+ }
781
+ }
782
+ },
783
+ "required": [
784
+ "id",
785
+ "isVerified"
786
+ ]
787
+ },
788
+ "AuthWithTokensResponseDto": {
789
+ "type": "object",
790
+ "properties": {
791
+ "accessToken": {
792
+ "type": "string",
793
+ "description": "JWT access token (short-lived)",
794
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJpYXQiOjE2OTk5OTk5OTksImV4cCI6MTY5OTk5OTk5OX0.xyz"
795
+ },
796
+ "refreshToken": {
797
+ "type": "string",
798
+ "description": "JWT refresh token (long-lived)",
799
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJ0eXBlIjoicmVmcmVzaCIsImlhdCI6MTY5OTk5OTk5OX0.abc"
800
+ },
801
+ "message": {
802
+ "type": "string",
803
+ "description": "Success message (added by controller based on configuration)",
804
+ "example": "Login successful"
805
+ },
806
+ "isRequiresMfa": {
807
+ "type": "boolean",
808
+ "description": "Whether multi-factor authentication is required",
809
+ "example": false
810
+ },
811
+ "mfaMethods": {
812
+ "type": "array",
813
+ "description": "Available MFA methods when isRequiresMfa is true",
814
+ "example": [
815
+ "email",
816
+ "totp"
817
+ ],
818
+ "items": {
819
+ "type": "string",
820
+ "enum": [
821
+ "email",
822
+ "sms",
823
+ "totp"
824
+ ]
825
+ }
826
+ },
827
+ "defaultMfaMethod": {
828
+ "type": "string",
829
+ "description": "Default/recommended MFA method",
830
+ "example": "email",
831
+ "enum": [
832
+ "email",
833
+ "sms",
834
+ "totp"
835
+ ]
836
+ },
837
+ "user": {
838
+ "description": "User information",
839
+ "allOf": [
840
+ {
841
+ "$ref": "#/components/schemas/UserResponseDto"
842
+ }
843
+ ]
844
+ }
845
+ },
846
+ "required": [
847
+ "accessToken",
848
+ "refreshToken",
849
+ "isRequiresMfa"
850
+ ]
851
+ },
852
+ "EmailCredentialsDto": {
853
+ "type": "object",
854
+ "properties": {
855
+ "email": {
856
+ "type": "string",
857
+ "description": "User email address",
858
+ "example": "user@example.com"
859
+ },
860
+ "password": {
861
+ "type": "string",
862
+ "description": "User password",
863
+ "example": "SecurePass123!",
864
+ "minLength": 8
865
+ }
866
+ },
867
+ "required": [
868
+ "email",
869
+ "password"
870
+ ]
871
+ },
872
+ "PhoneCredentialsDto": {
873
+ "type": "object",
874
+ "properties": {
875
+ "phone": {
876
+ "type": "string",
877
+ "description": "User phone number",
878
+ "example": "+1234567890"
879
+ },
880
+ "password": {
881
+ "type": "string",
882
+ "description": "User password",
883
+ "example": "SecurePass123!",
884
+ "minLength": 8
885
+ }
886
+ },
887
+ "required": [
888
+ "phone",
889
+ "password"
890
+ ]
891
+ },
892
+ "SocialCredentialsDto": {
893
+ "type": "object",
894
+ "properties": {
895
+ "token": {
896
+ "type": "string",
897
+ "description": "OAuth token or ID token from social provider",
898
+ "example": "ya29.a0AfH6SMBx1234567890abcdefghijklmnop"
899
+ }
900
+ },
901
+ "required": [
902
+ "token"
903
+ ]
904
+ },
905
+ "NestAuthLoginRequestDto": {
906
+ "type": "object",
907
+ "properties": {
908
+ "providerName": {
909
+ "type": "string",
910
+ "description": "Authentication provider name",
911
+ "example": "email",
912
+ "enum": [
913
+ "email",
914
+ "phone",
915
+ "google",
916
+ "facebook",
917
+ "apple",
918
+ "github"
919
+ ],
920
+ "default": "email"
921
+ },
922
+ "credentials": {
923
+ "description": "Login credentials - type varies by provider",
924
+ "examples": {
925
+ "emailLogin": {
926
+ "summary": "Email Login",
927
+ "value": {
928
+ "email": "user@example.com",
929
+ "password": "SecurePass123!"
930
+ }
931
+ },
932
+ "phoneLogin": {
933
+ "summary": "Phone Login",
934
+ "value": {
935
+ "phone": "+1234567890",
936
+ "password": "SecurePass123!"
937
+ }
938
+ },
939
+ "socialLogin": {
940
+ "summary": "Social Login (Google/Facebook/etc)",
941
+ "value": {
942
+ "token": "ya29.a0AfH6SMBx...",
943
+ "type": "idToken"
944
+ }
945
+ }
946
+ },
947
+ "oneOf": [
948
+ {
949
+ "$ref": "#/components/schemas/EmailCredentialsDto"
950
+ },
951
+ {
952
+ "$ref": "#/components/schemas/PhoneCredentialsDto"
953
+ },
954
+ {
955
+ "$ref": "#/components/schemas/SocialCredentialsDto"
956
+ }
957
+ ]
958
+ },
959
+ "tenantId": {
960
+ "type": "string",
961
+ "description": "Tenant ID for multi-tenant applications",
962
+ "example": "123e4567-e89b-12d3-a456-426614174000"
963
+ },
964
+ "createUserIfNotExists": {
965
+ "type": "boolean",
966
+ "description": "Auto-create user if not exists (for social auth)",
967
+ "default": false
968
+ }
969
+ },
970
+ "required": [
971
+ "credentials"
972
+ ]
973
+ },
974
+ "NestAuthRefreshTokenRequestDto": {
975
+ "type": "object",
976
+ "properties": {
977
+ "refreshToken": {
978
+ "type": "string",
979
+ "description": "Refresh token to obtain new access token",
980
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJ0eXBlIjoicmVmcmVzaCJ9.abc123"
981
+ }
982
+ },
983
+ "required": [
984
+ "refreshToken"
985
+ ]
986
+ },
987
+ "NestAuthMfaCodeSentResponseDto": {
988
+ "type": "object",
989
+ "properties": {
990
+ "message": {
991
+ "type": "string",
992
+ "description": "Response message",
993
+ "example": "MFA code sent successfully"
994
+ }
995
+ },
996
+ "required": [
997
+ "message"
998
+ ]
999
+ },
1000
+ "NestAuthMFAMethodEnum": {
1001
+ "type": "string",
1002
+ "enum": [
1003
+ "email",
1004
+ "sms",
1005
+ "totp"
1006
+ ]
1007
+ },
1008
+ "NestAuthVerify2faRequestDto": {
1009
+ "type": "object",
1010
+ "properties": {
1011
+ "method": {
1012
+ "description": "MFA method used",
1013
+ "example": "totp",
1014
+ "allOf": [
1015
+ {
1016
+ "$ref": "#/components/schemas/NestAuthMFAMethodEnum"
1017
+ }
1018
+ ]
1019
+ },
1020
+ "otp": {
1021
+ "type": "string",
1022
+ "description": "One-time password code",
1023
+ "example": "123456",
1024
+ "minLength": 6,
1025
+ "maxLength": 8
1026
+ },
1027
+ "rememberDevice": {
1028
+ "type": "boolean",
1029
+ "description": "Whether to trust this device for future logins",
1030
+ "example": true
1031
+ }
1032
+ },
1033
+ "required": [
1034
+ "method",
1035
+ "otp"
1036
+ ]
1037
+ },
1038
+ "Verify2faWithTokensResponseDto": {
1039
+ "type": "object",
1040
+ "properties": {
1041
+ "accessToken": {
1042
+ "type": "string",
1043
+ "description": "JWT access token (short-lived)",
1044
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJpYXQiOjE2OTk5OTk5OTksImV4cCI6MTY5OTk5OTk5OX0.xyz"
1045
+ },
1046
+ "refreshToken": {
1047
+ "type": "string",
1048
+ "description": "JWT refresh token (long-lived)",
1049
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjMiLCJ0eXBlIjoicmVmcmVzaCIsImlhdCI6MTY5OTk5OTk5OX0.abc"
1050
+ },
1051
+ "message": {
1052
+ "type": "string",
1053
+ "description": "Verification success message (added by controller)",
1054
+ "example": "2FA verification successful"
1055
+ }
1056
+ },
1057
+ "required": [
1058
+ "accessToken",
1059
+ "refreshToken"
1060
+ ]
1061
+ },
1062
+ "NestAuthLogoutResponseDto": {
1063
+ "type": "object",
1064
+ "properties": {
1065
+ "message": {
1066
+ "type": "string",
1067
+ "description": "Response message",
1068
+ "example": "Logged out successfully"
1069
+ }
1070
+ },
1071
+ "required": [
1072
+ "message"
1073
+ ]
1074
+ },
1075
+ "NestAuthLogoutAllResponseDto": {
1076
+ "type": "object",
1077
+ "properties": {
1078
+ "message": {
1079
+ "type": "string",
1080
+ "description": "Response message",
1081
+ "example": "Logged out from all devices"
1082
+ }
1083
+ },
1084
+ "required": [
1085
+ "message"
1086
+ ]
1087
+ },
1088
+ "NestAuthChangePasswordRequestDto": {
1089
+ "type": "object",
1090
+ "properties": {
1091
+ "currentPassword": {
1092
+ "type": "string",
1093
+ "description": "Current password",
1094
+ "example": "DemoOwner1!",
1095
+ "minLength": 8
1096
+ },
1097
+ "newPassword": {
1098
+ "type": "string",
1099
+ "description": "New password",
1100
+ "example": "DemoOwner1!New",
1101
+ "minLength": 8
1102
+ }
1103
+ },
1104
+ "required": [
1105
+ "currentPassword",
1106
+ "newPassword"
1107
+ ]
1108
+ },
1109
+ "NestAuthForgotPasswordRequestDto": {
1110
+ "type": "object",
1111
+ "properties": {
1112
+ "email": {
1113
+ "type": "string",
1114
+ "description": "User email address (required if phone not provided)",
1115
+ "example": "user@example.com"
1116
+ },
1117
+ "phone": {
1118
+ "type": "string",
1119
+ "description": "User phone number (required if email not provided)",
1120
+ "example": "+1234567890"
1121
+ },
1122
+ "tenantId": {
1123
+ "type": "string",
1124
+ "description": "Tenant ID for multi-tenant applications",
1125
+ "example": "123e4567-e89b-12d3-a456-426614174000"
1126
+ }
1127
+ }
1128
+ },
1129
+ "NestAuthPasswordResetLinkSentResponseDto": {
1130
+ "type": "object",
1131
+ "properties": {
1132
+ "message": {
1133
+ "type": "string",
1134
+ "description": "Response message",
1135
+ "example": "If your email is registered, you will receive a password reset link"
1136
+ }
1137
+ },
1138
+ "required": [
1139
+ "message"
1140
+ ]
1141
+ },
1142
+ "NestAuthVerifyForgotPasswordOtpRequestDto": {
1143
+ "type": "object",
1144
+ "properties": {
1145
+ "email": {
1146
+ "type": "string",
1147
+ "description": "User email address (required if phone not provided)",
1148
+ "example": "user@example.com"
1149
+ },
1150
+ "phone": {
1151
+ "type": "string",
1152
+ "description": "User phone number (required if email not provided)",
1153
+ "example": "+1234567890"
1154
+ },
1155
+ "otp": {
1156
+ "type": "string",
1157
+ "description": "One-time password code received via email or SMS",
1158
+ "example": "123456",
1159
+ "minLength": 6,
1160
+ "maxLength": 8
1161
+ },
1162
+ "tenantId": {
1163
+ "type": "string",
1164
+ "description": "Tenant ID for multi-tenant applications",
1165
+ "example": "123e4567-e89b-12d3-a456-426614174000"
1166
+ }
1167
+ },
1168
+ "required": [
1169
+ "otp"
1170
+ ]
1171
+ },
1172
+ "VerifyOtpResponseDto": {
1173
+ "type": "object",
1174
+ "properties": {
1175
+ "message": {
1176
+ "type": "string",
1177
+ "description": "Success message"
1178
+ },
1179
+ "resetToken": {
1180
+ "type": "string",
1181
+ "description": "Password reset token - use this to reset password"
1182
+ }
1183
+ },
1184
+ "required": [
1185
+ "message"
1186
+ ]
1187
+ },
1188
+ "NestAuthResetPasswordWithTokenRequestDto": {
1189
+ "type": "object",
1190
+ "properties": {
1191
+ "token": {
1192
+ "type": "string",
1193
+ "description": "Password reset token (JWT) received after OTP verification",
1194
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoicGFzc3dvcmQtcmVzZXQifQ.xyz"
1195
+ },
1196
+ "newPassword": {
1197
+ "type": "string",
1198
+ "description": "New password",
1199
+ "example": "NewSecurePass123!",
1200
+ "minLength": 8
1201
+ }
1202
+ },
1203
+ "required": [
1204
+ "token",
1205
+ "newPassword"
1206
+ ]
1207
+ },
1208
+ "NestAuthPasswordResetResponseDto": {
1209
+ "type": "object",
1210
+ "properties": {
1211
+ "message": {
1212
+ "type": "string",
1213
+ "description": "Response message",
1214
+ "example": "Password has been reset successfully"
1215
+ }
1216
+ },
1217
+ "required": [
1218
+ "message"
1219
+ ]
1220
+ },
1221
+ "NestAuthSendEmailVerificationRequestDto": {
1222
+ "type": "object",
1223
+ "properties": {
1224
+ "tenantId": {
1225
+ "type": "string",
1226
+ "description": "Tenant ID for multi-tenant applications",
1227
+ "example": "123e4567-e89b-12d3-a456-426614174000"
1228
+ }
1229
+ }
1230
+ },
1231
+ "NestAuthEmailVerificationSentResponseDto": {
1232
+ "type": "object",
1233
+ "properties": {
1234
+ "message": {
1235
+ "type": "string",
1236
+ "description": "Response message",
1237
+ "example": "Verification email sent"
1238
+ }
1239
+ },
1240
+ "required": [
1241
+ "message"
1242
+ ]
1243
+ },
1244
+ "NestAuthVerifyEmailRequestDto": {
1245
+ "type": "object",
1246
+ "properties": {
1247
+ "otp": {
1248
+ "type": "string",
1249
+ "description": "One-time password code received via email",
1250
+ "example": "123456",
1251
+ "minLength": 6,
1252
+ "maxLength": 8
1253
+ },
1254
+ "tenantId": {
1255
+ "type": "string",
1256
+ "description": "Tenant ID for multi-tenant applications",
1257
+ "example": "123e4567-e89b-12d3-a456-426614174000"
1258
+ }
1259
+ },
1260
+ "required": [
1261
+ "otp"
1262
+ ]
1263
+ },
1264
+ "NestAuthEmailVerifiedResponseDto": {
1265
+ "type": "object",
1266
+ "properties": {
1267
+ "message": {
1268
+ "type": "string",
1269
+ "description": "Response message",
1270
+ "example": "Email verified successfully"
1271
+ }
1272
+ },
1273
+ "required": [
1274
+ "message"
1275
+ ]
1276
+ },
1277
+ "EmailAuthConfigDto": {
1278
+ "type": "object",
1279
+ "properties": {
1280
+ "enabled": {
1281
+ "type": "boolean",
1282
+ "example": true
1283
+ }
1284
+ },
1285
+ "required": [
1286
+ "enabled"
1287
+ ]
1288
+ },
1289
+ "PhoneAuthConfigDto": {
1290
+ "type": "object",
1291
+ "properties": {
1292
+ "enabled": {
1293
+ "type": "boolean",
1294
+ "example": false
1295
+ }
1296
+ },
1297
+ "required": [
1298
+ "enabled"
1299
+ ]
1300
+ },
1301
+ "RegistrationConfigDto": {
1302
+ "type": "object",
1303
+ "properties": {
1304
+ "enabled": {
1305
+ "type": "boolean",
1306
+ "example": true,
1307
+ "description": "Whether user registration is enabled"
1308
+ },
1309
+ "requireInvitation": {
1310
+ "type": "boolean",
1311
+ "example": false,
1312
+ "description": "Whether registration requires an invitation"
1313
+ },
1314
+ "collectProfileFields": {
1315
+ "type": "array",
1316
+ "description": "Additional profile fields to collect during registration",
1317
+ "items": {
1318
+ "type": "object",
1319
+ "properties": {
1320
+ "id": {
1321
+ "type": "string"
1322
+ },
1323
+ "label": {
1324
+ "type": "string"
1325
+ },
1326
+ "required": {
1327
+ "type": "boolean"
1328
+ },
1329
+ "type": {
1330
+ "type": "string",
1331
+ "enum": [
1332
+ "text",
1333
+ "email",
1334
+ "phone",
1335
+ "select",
1336
+ "checkbox",
1337
+ "password"
1338
+ ]
1339
+ },
1340
+ "placeholder": {
1341
+ "type": "string"
1342
+ },
1343
+ "options": {
1344
+ "type": "array",
1345
+ "items": {
1346
+ "type": "object",
1347
+ "properties": {
1348
+ "label": {
1349
+ "type": "string"
1350
+ },
1351
+ "value": {
1352
+ "type": "string"
1353
+ }
1354
+ }
1355
+ }
1356
+ }
1357
+ }
1358
+ }
1359
+ }
1360
+ },
1361
+ "required": [
1362
+ "enabled"
1363
+ ]
1364
+ },
1365
+ "MfaConfigDto": {
1366
+ "type": "object",
1367
+ "properties": {
1368
+ "enabled": {
1369
+ "type": "boolean",
1370
+ "example": true
1371
+ },
1372
+ "methods": {
1373
+ "example": [
1374
+ "email",
1375
+ "totp"
1376
+ ],
1377
+ "type": "array",
1378
+ "items": {
1379
+ "type": "array"
1380
+ }
1381
+ },
1382
+ "allowUserToggle": {
1383
+ "type": "boolean",
1384
+ "example": true
1385
+ },
1386
+ "allowMethodSelection": {
1387
+ "type": "boolean",
1388
+ "example": true
1389
+ }
1390
+ },
1391
+ "required": [
1392
+ "enabled"
1393
+ ]
1394
+ },
1395
+ "TenantOptionDto": {
1396
+ "type": "object",
1397
+ "properties": {
1398
+ "id": {
1399
+ "type": "string"
1400
+ },
1401
+ "name": {
1402
+ "type": "string"
1403
+ },
1404
+ "slug": {
1405
+ "type": "string"
1406
+ },
1407
+ "isActive": {
1408
+ "type": "boolean"
1409
+ },
1410
+ "metadata": {
1411
+ "type": "object"
1412
+ }
1413
+ },
1414
+ "required": [
1415
+ "id",
1416
+ "name",
1417
+ "slug",
1418
+ "isActive"
1419
+ ]
1420
+ },
1421
+ "TenantsConfigDto": {
1422
+ "type": "object",
1423
+ "properties": {
1424
+ "mode": {
1425
+ "type": "string",
1426
+ "example": "single",
1427
+ "enum": [
1428
+ "single",
1429
+ "multi"
1430
+ ]
1431
+ },
1432
+ "defaultTenantId": {
1433
+ "type": "string",
1434
+ "nullable": true
1435
+ },
1436
+ "options": {
1437
+ "type": "array",
1438
+ "items": {
1439
+ "$ref": "#/components/schemas/TenantOptionDto"
1440
+ }
1441
+ }
1442
+ },
1443
+ "required": [
1444
+ "mode"
1445
+ ]
1446
+ },
1447
+ "SsoProviderConfigDto": {
1448
+ "type": "object",
1449
+ "properties": {
1450
+ "id": {
1451
+ "type": "string"
1452
+ },
1453
+ "name": {
1454
+ "type": "string"
1455
+ },
1456
+ "logoUrl": {
1457
+ "type": "string"
1458
+ },
1459
+ "authorizationUrl": {
1460
+ "type": "string"
1461
+ },
1462
+ "clientId": {
1463
+ "type": "string"
1464
+ },
1465
+ "hint": {
1466
+ "type": "string"
1467
+ }
1468
+ },
1469
+ "required": [
1470
+ "id",
1471
+ "name"
1472
+ ]
1473
+ },
1474
+ "SsoConfigDto": {
1475
+ "type": "object",
1476
+ "properties": {
1477
+ "enabled": {
1478
+ "type": "boolean",
1479
+ "example": false
1480
+ },
1481
+ "providers": {
1482
+ "type": "array",
1483
+ "items": {
1484
+ "$ref": "#/components/schemas/SsoProviderConfigDto"
1485
+ }
1486
+ }
1487
+ },
1488
+ "required": [
1489
+ "enabled"
1490
+ ]
1491
+ },
1492
+ "UiConfigDto": {
1493
+ "type": "object",
1494
+ "properties": {
1495
+ "brandName": {
1496
+ "type": "string"
1497
+ },
1498
+ "brandColor": {
1499
+ "type": "string"
1500
+ },
1501
+ "logoUrl": {
1502
+ "type": "string"
1503
+ },
1504
+ "backgroundImageUrl": {
1505
+ "type": "string"
1506
+ }
1507
+ }
1508
+ },
1509
+ "ClientConfigResponseDto": {
1510
+ "type": "object",
1511
+ "properties": {
1512
+ "emailAuth": {
1513
+ "$ref": "#/components/schemas/EmailAuthConfigDto"
1514
+ },
1515
+ "phoneAuth": {
1516
+ "$ref": "#/components/schemas/PhoneAuthConfigDto"
1517
+ },
1518
+ "registration": {
1519
+ "$ref": "#/components/schemas/RegistrationConfigDto"
1520
+ },
1521
+ "mfa": {
1522
+ "$ref": "#/components/schemas/MfaConfigDto"
1523
+ },
1524
+ "tenants": {
1525
+ "$ref": "#/components/schemas/TenantsConfigDto"
1526
+ },
1527
+ "sso": {
1528
+ "$ref": "#/components/schemas/SsoConfigDto"
1529
+ },
1530
+ "ui": {
1531
+ "$ref": "#/components/schemas/UiConfigDto"
1532
+ }
1533
+ },
1534
+ "required": [
1535
+ "emailAuth",
1536
+ "phoneAuth",
1537
+ "registration",
1538
+ "mfa",
1539
+ "tenants",
1540
+ "sso"
1541
+ ]
1542
+ },
1543
+ "MfaDeviceDto": {
1544
+ "type": "object",
1545
+ "properties": {
1546
+ "id": {
1547
+ "type": "string",
1548
+ "description": "Unique identifier of the MFA device",
1549
+ "example": "4b3c9c9c-9a9d-4d1e-8d9f-123456789abc"
1550
+ },
1551
+ "deviceName": {
1552
+ "type": "string",
1553
+ "description": "Friendly name of the registered device",
1554
+ "example": "Work laptop"
1555
+ },
1556
+ "method": {
1557
+ "type": "string",
1558
+ "description": "MFA method this device supports",
1559
+ "enum": [
1560
+ "email",
1561
+ "sms",
1562
+ "totp"
1563
+ ],
1564
+ "example": "totp"
1565
+ },
1566
+ "lastUsedAt": {
1567
+ "format": "date-time",
1568
+ "type": "string",
1569
+ "description": "Timestamp of when the device was last used",
1570
+ "example": "2024-05-20T12:34:56.000Z"
1571
+ },
1572
+ "verified": {
1573
+ "type": "boolean",
1574
+ "description": "Whether the device setup has been verified",
1575
+ "example": true
1576
+ },
1577
+ "createdAt": {
1578
+ "format": "date-time",
1579
+ "type": "string",
1580
+ "description": "Timestamp of when the device was registered",
1581
+ "example": "2024-05-18T10:15:00.000Z"
1582
+ }
1583
+ },
1584
+ "required": [
1585
+ "id",
1586
+ "deviceName",
1587
+ "method",
1588
+ "verified"
1589
+ ]
1590
+ },
1591
+ "MfaStatusResponseDto": {
1592
+ "type": "object",
1593
+ "properties": {
1594
+ "isEnabled": {
1595
+ "type": "boolean",
1596
+ "description": "Whether MFA is currently enabled for the user",
1597
+ "example": true
1598
+ },
1599
+ "verifiedMethods": {
1600
+ "type": "array",
1601
+ "description": "MFA methods the user has verified and can currently use (includes EMAIL/SMS if configured, and TOTP if user has verified device)",
1602
+ "example": [
1603
+ "email",
1604
+ "totp"
1605
+ ],
1606
+ "items": {
1607
+ "type": "string",
1608
+ "enum": [
1609
+ "email",
1610
+ "sms",
1611
+ "totp"
1612
+ ]
1613
+ }
1614
+ },
1615
+ "configuredMethods": {
1616
+ "type": "array",
1617
+ "description": "All MFA methods configured and available in the application (methods user can potentially set up)",
1618
+ "example": [
1619
+ "email",
1620
+ "totp",
1621
+ "sms"
1622
+ ],
1623
+ "items": {
1624
+ "type": "string",
1625
+ "enum": [
1626
+ "email",
1627
+ "sms",
1628
+ "totp"
1629
+ ]
1630
+ }
1631
+ },
1632
+ "allowUserToggle": {
1633
+ "type": "boolean",
1634
+ "description": "Indicates if MFA toggling is allowed for the user",
1635
+ "example": true
1636
+ },
1637
+ "allowMethodSelection": {
1638
+ "type": "boolean",
1639
+ "description": "Indicates if users can choose their preferred MFA method",
1640
+ "example": true
1641
+ },
1642
+ "totpDevices": {
1643
+ "description": "Registered TOTP devices for the user",
1644
+ "type": "array",
1645
+ "items": {
1646
+ "$ref": "#/components/schemas/MfaDeviceDto"
1647
+ }
1648
+ },
1649
+ "hasRecoveryCode": {
1650
+ "type": "boolean",
1651
+ "description": "Whether a recovery code has been generated for the user",
1652
+ "example": false
1653
+ }
1654
+ },
1655
+ "required": [
1656
+ "isEnabled",
1657
+ "verifiedMethods",
1658
+ "configuredMethods",
1659
+ "allowUserToggle",
1660
+ "allowMethodSelection",
1661
+ "totpDevices",
1662
+ "hasRecoveryCode"
1663
+ ]
1664
+ },
1665
+ "NestAuthToggleMfaRequestDto": {
1666
+ "type": "object",
1667
+ "properties": {
1668
+ "enabled": {
1669
+ "type": "boolean",
1670
+ "description": "Whether MFA should be enabled for the current user",
1671
+ "example": true
1672
+ }
1673
+ },
1674
+ "required": [
1675
+ "enabled"
1676
+ ]
1677
+ },
1678
+ "NestAuthMfaToggleResponseDto": {
1679
+ "type": "object",
1680
+ "properties": {
1681
+ "message": {
1682
+ "type": "string",
1683
+ "description": "Response message",
1684
+ "example": "MFA enabled successfully"
1685
+ }
1686
+ },
1687
+ "required": [
1688
+ "message"
1689
+ ]
1690
+ },
1691
+ "NestAuthMfaDeviceRemovedResponseDto": {
1692
+ "type": "object",
1693
+ "properties": {
1694
+ "message": {
1695
+ "type": "string",
1696
+ "description": "Response message",
1697
+ "example": "Device removed successfully"
1698
+ }
1699
+ },
1700
+ "required": [
1701
+ "message"
1702
+ ]
1703
+ },
1704
+ "NestAuthSendMfaCodeRequestDto": {
1705
+ "type": "object",
1706
+ "properties": {
1707
+ "method": {
1708
+ "description": "MFA delivery method",
1709
+ "example": "email",
1710
+ "examples": {
1711
+ "email": {
1712
+ "value": "email",
1713
+ "description": "Send OTP via email"
1714
+ },
1715
+ "sms": {
1716
+ "value": "sms",
1717
+ "description": "Send OTP via SMS"
1718
+ },
1719
+ "totp": {
1720
+ "value": "totp",
1721
+ "description": "Use authenticator app (TOTP)"
1722
+ }
1723
+ },
1724
+ "allOf": [
1725
+ {
1726
+ "$ref": "#/components/schemas/NestAuthMFAMethodEnum"
1727
+ }
1728
+ ]
1729
+ }
1730
+ },
1731
+ "required": [
1732
+ "method"
1733
+ ]
1734
+ },
1735
+ "NestAuthVerifyTotpSetupRequestDto": {
1736
+ "type": "object",
1737
+ "properties": {
1738
+ "otp": {
1739
+ "type": "string",
1740
+ "description": "The TOTP code from authenticator app",
1741
+ "example": "123456",
1742
+ "minLength": 6,
1743
+ "maxLength": 6
1744
+ },
1745
+ "secret": {
1746
+ "type": "string",
1747
+ "description": "Secret key from TOTP setup",
1748
+ "example": "JBSWY3DPEHPK3PXP"
1749
+ }
1750
+ },
1751
+ "required": [
1752
+ "otp",
1753
+ "secret"
1754
+ ]
1755
+ },
1756
+ "NestAuthMfaDeviceVerifiedResponseDto": {
1757
+ "type": "object",
1758
+ "properties": {
1759
+ "message": {
1760
+ "type": "string",
1761
+ "description": "Response message",
1762
+ "example": "Device setup successfully"
1763
+ }
1764
+ },
1765
+ "required": [
1766
+ "message"
1767
+ ]
1768
+ },
1769
+ "NestAuthMfaResetResponseDto": {
1770
+ "type": "object",
1771
+ "properties": {
1772
+ "message": {
1773
+ "type": "string",
1774
+ "description": "Response message",
1775
+ "example": "MFA reset successfully"
1776
+ }
1777
+ },
1778
+ "required": [
1779
+ "message"
1780
+ ]
1781
+ }
1782
+ }
1783
+ }
1784
+ }