@payez/next-mvp 4.0.0 → 4.0.1

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 (459) hide show
  1. package/package.json +6 -16
  2. package/dist/api/auth-handler.d.ts +0 -66
  3. package/dist/api/auth-handler.js +0 -397
  4. package/dist/api/index.d.ts +0 -10
  5. package/dist/api/index.js +0 -19
  6. package/dist/api-handlers/account/change-password.d.ts +0 -9
  7. package/dist/api-handlers/account/change-password.js +0 -110
  8. package/dist/api-handlers/account/masked-info.d.ts +0 -2
  9. package/dist/api-handlers/account/masked-info.js +0 -41
  10. package/dist/api-handlers/account/profile.d.ts +0 -3
  11. package/dist/api-handlers/account/profile.js +0 -63
  12. package/dist/api-handlers/account/recovery/initiate.d.ts +0 -2
  13. package/dist/api-handlers/account/recovery/initiate.js +0 -26
  14. package/dist/api-handlers/account/recovery/send-code.d.ts +0 -2
  15. package/dist/api-handlers/account/recovery/send-code.js +0 -28
  16. package/dist/api-handlers/account/recovery/verify-code.d.ts +0 -2
  17. package/dist/api-handlers/account/recovery/verify-code.js +0 -28
  18. package/dist/api-handlers/account/reset-password.d.ts +0 -2
  19. package/dist/api-handlers/account/reset-password.js +0 -26
  20. package/dist/api-handlers/account/send-code.d.ts +0 -24
  21. package/dist/api-handlers/account/send-code.js +0 -60
  22. package/dist/api-handlers/account/update-phone.d.ts +0 -27
  23. package/dist/api-handlers/account/update-phone.js +0 -64
  24. package/dist/api-handlers/account/validate-password.d.ts +0 -17
  25. package/dist/api-handlers/account/validate-password.js +0 -81
  26. package/dist/api-handlers/account/verify-email.d.ts +0 -26
  27. package/dist/api-handlers/account/verify-email.js +0 -106
  28. package/dist/api-handlers/account/verify-sms.d.ts +0 -26
  29. package/dist/api-handlers/account/verify-sms.js +0 -106
  30. package/dist/api-handlers/admin/analytics.d.ts +0 -19
  31. package/dist/api-handlers/admin/analytics.js +0 -378
  32. package/dist/api-handlers/admin/audit.d.ts +0 -19
  33. package/dist/api-handlers/admin/audit.js +0 -213
  34. package/dist/api-handlers/admin/index.d.ts +0 -21
  35. package/dist/api-handlers/admin/index.js +0 -42
  36. package/dist/api-handlers/admin/redis-sessions.d.ts +0 -35
  37. package/dist/api-handlers/admin/redis-sessions.js +0 -203
  38. package/dist/api-handlers/admin/sessions.d.ts +0 -20
  39. package/dist/api-handlers/admin/sessions.js +0 -283
  40. package/dist/api-handlers/admin/site-logs.d.ts +0 -45
  41. package/dist/api-handlers/admin/site-logs.js +0 -317
  42. package/dist/api-handlers/admin/stats.d.ts +0 -20
  43. package/dist/api-handlers/admin/stats.js +0 -239
  44. package/dist/api-handlers/admin/users.d.ts +0 -19
  45. package/dist/api-handlers/admin/users.js +0 -221
  46. package/dist/api-handlers/admin/vibe-data.d.ts +0 -79
  47. package/dist/api-handlers/admin/vibe-data.js +0 -267
  48. package/dist/api-handlers/anon/preferences.d.ts +0 -37
  49. package/dist/api-handlers/anon/preferences.js +0 -96
  50. package/dist/api-handlers/auth/jwks.d.ts +0 -2
  51. package/dist/api-handlers/auth/jwks.js +0 -24
  52. package/dist/api-handlers/auth/login.d.ts +0 -42
  53. package/dist/api-handlers/auth/login.js +0 -178
  54. package/dist/api-handlers/auth/refresh.d.ts +0 -74
  55. package/dist/api-handlers/auth/refresh.js +0 -633
  56. package/dist/api-handlers/auth/signout.d.ts +0 -37
  57. package/dist/api-handlers/auth/signout.js +0 -186
  58. package/dist/api-handlers/auth/status.d.ts +0 -8
  59. package/dist/api-handlers/auth/status.js +0 -23
  60. package/dist/api-handlers/auth/update-session.d.ts +0 -37
  61. package/dist/api-handlers/auth/update-session.js +0 -93
  62. package/dist/api-handlers/auth/validate.d.ts +0 -6
  63. package/dist/api-handlers/auth/validate.js +0 -43
  64. package/dist/api-handlers/auth/verify-code.d.ts +0 -43
  65. package/dist/api-handlers/auth/verify-code.js +0 -90
  66. package/dist/api-handlers/session/refresh-viability.d.ts +0 -14
  67. package/dist/api-handlers/session/refresh-viability.js +0 -39
  68. package/dist/api-handlers/session/viability.d.ts +0 -13
  69. package/dist/api-handlers/session/viability.js +0 -114
  70. package/dist/api-handlers/test/force-expire.d.ts +0 -23
  71. package/dist/api-handlers/test/force-expire.js +0 -59
  72. package/dist/auth/auth-decision.d.ts +0 -39
  73. package/dist/auth/auth-decision.js +0 -182
  74. package/dist/auth/auth-options.d.ts +0 -57
  75. package/dist/auth/auth-options.js +0 -213
  76. package/dist/auth/better-auth.d.ts +0 -79
  77. package/dist/auth/better-auth.js +0 -119
  78. package/dist/auth/callbacks/index.d.ts +0 -6
  79. package/dist/auth/callbacks/index.js +0 -12
  80. package/dist/auth/callbacks/jwt.d.ts +0 -45
  81. package/dist/auth/callbacks/jwt.js +0 -305
  82. package/dist/auth/callbacks/session.d.ts +0 -60
  83. package/dist/auth/callbacks/session.js +0 -170
  84. package/dist/auth/callbacks/signin.d.ts +0 -23
  85. package/dist/auth/callbacks/signin.js +0 -44
  86. package/dist/auth/events/index.d.ts +0 -4
  87. package/dist/auth/events/index.js +0 -8
  88. package/dist/auth/events/signout.d.ts +0 -17
  89. package/dist/auth/events/signout.js +0 -32
  90. package/dist/auth/providers/credentials.d.ts +0 -32
  91. package/dist/auth/providers/credentials.js +0 -223
  92. package/dist/auth/providers/index.d.ts +0 -5
  93. package/dist/auth/providers/index.js +0 -21
  94. package/dist/auth/providers/oauth.d.ts +0 -26
  95. package/dist/auth/providers/oauth.js +0 -105
  96. package/dist/auth/route-config.d.ts +0 -66
  97. package/dist/auth/route-config.js +0 -190
  98. package/dist/auth/types/auth-types.d.ts +0 -417
  99. package/dist/auth/types/auth-types.js +0 -53
  100. package/dist/auth/types/index.d.ts +0 -6
  101. package/dist/auth/types/index.js +0 -22
  102. package/dist/auth/unauthenticated-routes.d.ts +0 -1
  103. package/dist/auth/unauthenticated-routes.js +0 -19
  104. package/dist/auth/utils/idp-client.d.ts +0 -94
  105. package/dist/auth/utils/idp-client.js +0 -384
  106. package/dist/auth/utils/index.d.ts +0 -5
  107. package/dist/auth/utils/index.js +0 -21
  108. package/dist/auth/utils/token-utils.d.ts +0 -83
  109. package/dist/auth/utils/token-utils.js +0 -218
  110. package/dist/client/AuthContext.d.ts +0 -19
  111. package/dist/client/AuthContext.js +0 -115
  112. package/dist/client/better-auth-client.d.ts +0 -1020
  113. package/dist/client/better-auth-client.js +0 -68
  114. package/dist/client/fetch-with-auth.d.ts +0 -11
  115. package/dist/client/fetch-with-auth.js +0 -44
  116. package/dist/client/fetchWithSession.d.ts +0 -3
  117. package/dist/client/fetchWithSession.js +0 -24
  118. package/dist/client/index.d.ts +0 -9
  119. package/dist/client/index.js +0 -20
  120. package/dist/client/useAnonSession.d.ts +0 -36
  121. package/dist/client/useAnonSession.js +0 -99
  122. package/dist/components/SessionSync.d.ts +0 -13
  123. package/dist/components/SessionSync.js +0 -121
  124. package/dist/components/SignalRHealthCheck.d.ts +0 -10
  125. package/dist/components/SignalRHealthCheck.js +0 -97
  126. package/dist/components/account/MobileNavDrawer.d.ts +0 -32
  127. package/dist/components/account/MobileNavDrawer.js +0 -81
  128. package/dist/components/account/UserAvatarMenu.d.ts +0 -20
  129. package/dist/components/account/UserAvatarMenu.js +0 -91
  130. package/dist/components/account/index.d.ts +0 -9
  131. package/dist/components/account/index.js +0 -13
  132. package/dist/components/admin/AlertSettingsTab.d.ts +0 -48
  133. package/dist/components/admin/AlertSettingsTab.js +0 -351
  134. package/dist/components/admin/AnalyticsTab.d.ts +0 -22
  135. package/dist/components/admin/AnalyticsTab.js +0 -167
  136. package/dist/components/admin/DataBrowserTab.d.ts +0 -19
  137. package/dist/components/admin/DataBrowserTab.js +0 -252
  138. package/dist/components/admin/LoggingSettingsTab.d.ts +0 -73
  139. package/dist/components/admin/LoggingSettingsTab.js +0 -339
  140. package/dist/components/admin/SessionsTab.d.ts +0 -37
  141. package/dist/components/admin/SessionsTab.js +0 -165
  142. package/dist/components/admin/StatsTab.d.ts +0 -53
  143. package/dist/components/admin/StatsTab.js +0 -161
  144. package/dist/components/admin/VibeAdminContext.d.ts +0 -32
  145. package/dist/components/admin/VibeAdminContext.js +0 -38
  146. package/dist/components/admin/VibeAdminLayout.d.ts +0 -11
  147. package/dist/components/admin/VibeAdminLayout.js +0 -71
  148. package/dist/components/admin/index.d.ts +0 -29
  149. package/dist/components/admin/index.js +0 -44
  150. package/dist/components/auth/FederatedAuthSection.d.ts +0 -8
  151. package/dist/components/auth/FederatedAuthSection.js +0 -45
  152. package/dist/components/auth/ModeAwareLoginPage.d.ts +0 -10
  153. package/dist/components/auth/ModeAwareLoginPage.js +0 -42
  154. package/dist/components/auth/ModeAwareSignupPage.d.ts +0 -9
  155. package/dist/components/auth/ModeAwareSignupPage.js +0 -78
  156. package/dist/components/auth/TraditionalAuthSection.d.ts +0 -14
  157. package/dist/components/auth/TraditionalAuthSection.js +0 -20
  158. package/dist/components/recovery/CompleteStep.d.ts +0 -5
  159. package/dist/components/recovery/CompleteStep.js +0 -8
  160. package/dist/components/recovery/InitiateRecoveryStep.d.ts +0 -8
  161. package/dist/components/recovery/InitiateRecoveryStep.js +0 -20
  162. package/dist/components/recovery/SelectMethodStep.d.ts +0 -8
  163. package/dist/components/recovery/SelectMethodStep.js +0 -8
  164. package/dist/components/recovery/SetPasswordStep.d.ts +0 -6
  165. package/dist/components/recovery/SetPasswordStep.js +0 -20
  166. package/dist/components/recovery/VerifyCodeStep.d.ts +0 -10
  167. package/dist/components/recovery/VerifyCodeStep.js +0 -24
  168. package/dist/components/reserved/ReservedRecoveryWarning.d.ts +0 -38
  169. package/dist/components/reserved/ReservedRecoveryWarning.js +0 -92
  170. package/dist/components/reserved/ReservedStatusBox.d.ts +0 -30
  171. package/dist/components/reserved/ReservedStatusBox.js +0 -71
  172. package/dist/components/ui/BetaBadge.d.ts +0 -29
  173. package/dist/components/ui/BetaBadge.js +0 -38
  174. package/dist/components/ui/Footer.d.ts +0 -37
  175. package/dist/components/ui/Footer.js +0 -41
  176. package/dist/config/env.d.ts +0 -66
  177. package/dist/config/env.js +0 -57
  178. package/dist/config/logger.d.ts +0 -57
  179. package/dist/config/logger.js +0 -73
  180. package/dist/config/logging-config.d.ts +0 -30
  181. package/dist/config/logging-config.js +0 -122
  182. package/dist/config/unauthenticated-routes.d.ts +0 -17
  183. package/dist/config/unauthenticated-routes.js +0 -24
  184. package/dist/config/vibe-log-transport.d.ts +0 -81
  185. package/dist/config/vibe-log-transport.js +0 -212
  186. package/dist/edge/internal-api-url.d.ts +0 -53
  187. package/dist/edge/internal-api-url.js +0 -63
  188. package/dist/edge/middleware.d.ts +0 -14
  189. package/dist/edge/middleware.js +0 -32
  190. package/dist/hooks/useAuth.d.ts +0 -23
  191. package/dist/hooks/useAuth.js +0 -83
  192. package/dist/hooks/useAuthSettings.d.ts +0 -59
  193. package/dist/hooks/useAuthSettings.js +0 -93
  194. package/dist/hooks/useAvailableProviders.d.ts +0 -43
  195. package/dist/hooks/useAvailableProviders.js +0 -112
  196. package/dist/hooks/usePasswordValidation.d.ts +0 -27
  197. package/dist/hooks/usePasswordValidation.js +0 -102
  198. package/dist/hooks/useProfile.d.ts +0 -15
  199. package/dist/hooks/useProfile.js +0 -59
  200. package/dist/hooks/usePublicAuthSettings.d.ts +0 -56
  201. package/dist/hooks/usePublicAuthSettings.js +0 -131
  202. package/dist/hooks/useSessionExpiration.d.ts +0 -56
  203. package/dist/hooks/useSessionExpiration.js +0 -72
  204. package/dist/hooks/useViabilitySession.d.ts +0 -75
  205. package/dist/hooks/useViabilitySession.js +0 -269
  206. package/dist/index.d.ts +0 -12
  207. package/dist/index.js +0 -53
  208. package/dist/lib/anon-session.d.ts +0 -74
  209. package/dist/lib/anon-session.js +0 -169
  210. package/dist/lib/api-handler.d.ts +0 -123
  211. package/dist/lib/api-handler.js +0 -478
  212. package/dist/lib/app-slug.d.ts +0 -95
  213. package/dist/lib/app-slug.js +0 -172
  214. package/dist/lib/demo-mode.d.ts +0 -6
  215. package/dist/lib/demo-mode.js +0 -16
  216. package/dist/lib/geolocation.d.ts +0 -64
  217. package/dist/lib/geolocation.js +0 -235
  218. package/dist/lib/idp-client-config.d.ts +0 -75
  219. package/dist/lib/idp-client-config.js +0 -425
  220. package/dist/lib/idp-fetch.d.ts +0 -14
  221. package/dist/lib/idp-fetch.js +0 -91
  222. package/dist/lib/internal-api.d.ts +0 -87
  223. package/dist/lib/internal-api.js +0 -122
  224. package/dist/lib/jwt-decode-client.d.ts +0 -10
  225. package/dist/lib/jwt-decode-client.js +0 -46
  226. package/dist/lib/jwt-decode.d.ts +0 -48
  227. package/dist/lib/jwt-decode.js +0 -57
  228. package/dist/lib/nextauth-secret.d.ts +0 -10
  229. package/dist/lib/nextauth-secret.js +0 -100
  230. package/dist/lib/rate-limit-service.d.ts +0 -23
  231. package/dist/lib/rate-limit-service.js +0 -6
  232. package/dist/lib/redis.d.ts +0 -5
  233. package/dist/lib/redis.js +0 -28
  234. package/dist/lib/refresh-token-validator.d.ts +0 -13
  235. package/dist/lib/refresh-token-validator.js +0 -117
  236. package/dist/lib/roles.d.ts +0 -145
  237. package/dist/lib/roles.js +0 -168
  238. package/dist/lib/secret-validation.d.ts +0 -4
  239. package/dist/lib/secret-validation.js +0 -14
  240. package/dist/lib/session-store.d.ts +0 -170
  241. package/dist/lib/session-store.js +0 -545
  242. package/dist/lib/session.d.ts +0 -21
  243. package/dist/lib/session.js +0 -26
  244. package/dist/lib/site-logger.d.ts +0 -214
  245. package/dist/lib/site-logger.js +0 -210
  246. package/dist/lib/standardized-client-api.d.ts +0 -161
  247. package/dist/lib/standardized-client-api.js +0 -791
  248. package/dist/lib/startup-init.d.ts +0 -40
  249. package/dist/lib/startup-init.js +0 -257
  250. package/dist/lib/test-aware-get-token.d.ts +0 -2
  251. package/dist/lib/test-aware-get-token.js +0 -86
  252. package/dist/lib/token-expiry.d.ts +0 -14
  253. package/dist/lib/token-expiry.js +0 -39
  254. package/dist/lib/token-lifecycle.d.ts +0 -78
  255. package/dist/lib/token-lifecycle.js +0 -360
  256. package/dist/lib/types/api-responses.d.ts +0 -128
  257. package/dist/lib/types/api-responses.js +0 -171
  258. package/dist/lib/user-agent-parser.d.ts +0 -50
  259. package/dist/lib/user-agent-parser.js +0 -220
  260. package/dist/logging/api/admin-analytics.d.ts +0 -3
  261. package/dist/logging/api/admin-analytics.js +0 -45
  262. package/dist/logging/api/audit-log.d.ts +0 -3
  263. package/dist/logging/api/audit-log.js +0 -52
  264. package/dist/logging/components/AdminAnalyticsLayout.d.ts +0 -10
  265. package/dist/logging/components/AdminAnalyticsLayout.js +0 -11
  266. package/dist/logging/components/AuditLogViewer.d.ts +0 -7
  267. package/dist/logging/components/AuditLogViewer.js +0 -51
  268. package/dist/logging/components/ErrorMetricsCard.d.ts +0 -7
  269. package/dist/logging/components/ErrorMetricsCard.js +0 -16
  270. package/dist/logging/components/HealthMetricsCard.d.ts +0 -7
  271. package/dist/logging/components/HealthMetricsCard.js +0 -19
  272. package/dist/logging/hooks/useAdminAnalytics.d.ts +0 -24
  273. package/dist/logging/hooks/useAdminAnalytics.js +0 -22
  274. package/dist/logging/hooks/useAuditLog.d.ts +0 -6
  275. package/dist/logging/hooks/useAuditLog.js +0 -25
  276. package/dist/logging/hooks/useErrorMetrics.d.ts +0 -6
  277. package/dist/logging/hooks/useErrorMetrics.js +0 -38
  278. package/dist/logging/hooks/useHealthMetrics.d.ts +0 -6
  279. package/dist/logging/hooks/useHealthMetrics.js +0 -41
  280. package/dist/logging/index.d.ts +0 -11
  281. package/dist/logging/index.js +0 -40
  282. package/dist/logging/types/analytics.d.ts +0 -68
  283. package/dist/logging/types/analytics.js +0 -3
  284. package/dist/logging/types/audit.d.ts +0 -29
  285. package/dist/logging/types/audit.js +0 -2
  286. package/dist/logging/types/index.d.ts +0 -2
  287. package/dist/logging/types/index.js +0 -19
  288. package/dist/middleware/auth-decision.d.ts +0 -33
  289. package/dist/middleware/auth-decision.js +0 -65
  290. package/dist/middleware/create-middleware.d.ts +0 -102
  291. package/dist/middleware/create-middleware.js +0 -469
  292. package/dist/middleware/rbac-check.d.ts +0 -51
  293. package/dist/middleware/rbac-check.js +0 -219
  294. package/dist/middleware/twofa-presets.d.ts +0 -134
  295. package/dist/middleware/twofa-presets.js +0 -175
  296. package/dist/models/DecodedAccessToken.d.ts +0 -17
  297. package/dist/models/DecodedAccessToken.js +0 -2
  298. package/dist/models/SessionModel.d.ts +0 -122
  299. package/dist/models/SessionModel.js +0 -136
  300. package/dist/pages/admin-login/page.d.ts +0 -31
  301. package/dist/pages/admin-login/page.js +0 -73
  302. package/dist/pages/admin-page-permissions/PagePermissionsAdminPage.d.ts +0 -18
  303. package/dist/pages/admin-page-permissions/PagePermissionsAdminPage.js +0 -276
  304. package/dist/pages/admin-page-permissions/index.d.ts +0 -6
  305. package/dist/pages/admin-page-permissions/index.js +0 -13
  306. package/dist/pages/admin-roles/RolesAdminPage.d.ts +0 -16
  307. package/dist/pages/admin-roles/RolesAdminPage.js +0 -261
  308. package/dist/pages/admin-roles/index.d.ts +0 -8
  309. package/dist/pages/admin-roles/index.js +0 -15
  310. package/dist/pages/admin-roles/modals.d.ts +0 -72
  311. package/dist/pages/admin-roles/modals.js +0 -154
  312. package/dist/pages/client-admin/ClientSiteAdminPage.d.ts +0 -79
  313. package/dist/pages/client-admin/ClientSiteAdminPage.js +0 -179
  314. package/dist/pages/client-admin/index.d.ts +0 -32
  315. package/dist/pages/client-admin/index.js +0 -37
  316. package/dist/pages/coming-soon/page.d.ts +0 -8
  317. package/dist/pages/coming-soon/page.js +0 -28
  318. package/dist/pages/login/page.d.ts +0 -22
  319. package/dist/pages/login/page.js +0 -230
  320. package/dist/pages/profile/EnhancedProfilePage.d.ts +0 -13
  321. package/dist/pages/profile/EnhancedProfilePage.js +0 -150
  322. package/dist/pages/profile/index.d.ts +0 -8
  323. package/dist/pages/profile/index.js +0 -16
  324. package/dist/pages/profile/page.d.ts +0 -19
  325. package/dist/pages/profile/page.js +0 -47
  326. package/dist/pages/profile/profile-patch.d.ts +0 -1
  327. package/dist/pages/profile/profile-patch.js +0 -281
  328. package/dist/pages/recovery/page.d.ts +0 -1
  329. package/dist/pages/recovery/page.js +0 -142
  330. package/dist/pages/roles/MyRolesPage.d.ts +0 -24
  331. package/dist/pages/roles/MyRolesPage.js +0 -71
  332. package/dist/pages/roles/components.d.ts +0 -63
  333. package/dist/pages/roles/components.js +0 -108
  334. package/dist/pages/roles/index.d.ts +0 -8
  335. package/dist/pages/roles/index.js +0 -19
  336. package/dist/pages/security/EnhancedSecurityPage.d.ts +0 -14
  337. package/dist/pages/security/EnhancedSecurityPage.js +0 -248
  338. package/dist/pages/security/index.d.ts +0 -8
  339. package/dist/pages/security/index.js +0 -16
  340. package/dist/pages/security/page.d.ts +0 -21
  341. package/dist/pages/security/page.js +0 -212
  342. package/dist/pages/security/security-patch.d.ts +0 -1
  343. package/dist/pages/security/security-patch.js +0 -302
  344. package/dist/pages/settings/EnhancedSettingsPage.d.ts +0 -46
  345. package/dist/pages/settings/EnhancedSettingsPage.js +0 -231
  346. package/dist/pages/settings/index.d.ts +0 -8
  347. package/dist/pages/settings/index.js +0 -16
  348. package/dist/pages/settings/page.d.ts +0 -7
  349. package/dist/pages/settings/page.js +0 -26
  350. package/dist/pages/showcase/ShowcasePage.d.ts +0 -13
  351. package/dist/pages/showcase/ShowcasePage.js +0 -142
  352. package/dist/pages/showcase/index.d.ts +0 -12
  353. package/dist/pages/showcase/index.js +0 -17
  354. package/dist/pages/test-env/EmergencyLogoutPage.d.ts +0 -14
  355. package/dist/pages/test-env/EmergencyLogoutPage.js +0 -99
  356. package/dist/pages/test-env/JwtInspectPage.d.ts +0 -14
  357. package/dist/pages/test-env/JwtInspectPage.js +0 -116
  358. package/dist/pages/test-env/RefreshTokenPage.d.ts +0 -15
  359. package/dist/pages/test-env/RefreshTokenPage.js +0 -93
  360. package/dist/pages/test-env/TestEnvPage.d.ts +0 -13
  361. package/dist/pages/test-env/TestEnvPage.js +0 -51
  362. package/dist/pages/test-env/index.d.ts +0 -24
  363. package/dist/pages/test-env/index.js +0 -32
  364. package/dist/pages/verify-code/page.d.ts +0 -30
  365. package/dist/pages/verify-code/page.js +0 -412
  366. package/dist/routes/account/index.d.ts +0 -28
  367. package/dist/routes/account/index.js +0 -71
  368. package/dist/routes/account/masked-info.d.ts +0 -33
  369. package/dist/routes/account/masked-info.js +0 -39
  370. package/dist/routes/account/send-code.d.ts +0 -37
  371. package/dist/routes/account/send-code.js +0 -42
  372. package/dist/routes/account/update-phone.d.ts +0 -13
  373. package/dist/routes/account/update-phone.js +0 -17
  374. package/dist/routes/account/verify-email.d.ts +0 -38
  375. package/dist/routes/account/verify-email.js +0 -43
  376. package/dist/routes/account/verify-sms.d.ts +0 -38
  377. package/dist/routes/account/verify-sms.js +0 -43
  378. package/dist/routes/auth/index.d.ts +0 -19
  379. package/dist/routes/auth/index.js +0 -64
  380. package/dist/routes/auth/logout.d.ts +0 -31
  381. package/dist/routes/auth/logout.js +0 -98
  382. package/dist/routes/auth/nextauth.d.ts +0 -22
  383. package/dist/routes/auth/nextauth.js +0 -40
  384. package/dist/routes/auth/refresh.d.ts +0 -30
  385. package/dist/routes/auth/refresh.js +0 -51
  386. package/dist/routes/auth/session.d.ts +0 -43
  387. package/dist/routes/auth/session.js +0 -157
  388. package/dist/routes/auth/settings.d.ts +0 -25
  389. package/dist/routes/auth/settings.js +0 -55
  390. package/dist/routes/auth/viability.d.ts +0 -52
  391. package/dist/routes/auth/viability.js +0 -190
  392. package/dist/routes/index.d.ts +0 -12
  393. package/dist/routes/index.js +0 -54
  394. package/dist/routes/session/index.d.ts +0 -6
  395. package/dist/routes/session/index.js +0 -10
  396. package/dist/routes/session/refresh-viability.d.ts +0 -16
  397. package/dist/routes/session/refresh-viability.js +0 -20
  398. package/dist/server/auth-guard.d.ts +0 -46
  399. package/dist/server/auth-guard.js +0 -128
  400. package/dist/server/auth.d.ts +0 -50
  401. package/dist/server/auth.js +0 -62
  402. package/dist/server/decode-session.d.ts +0 -30
  403. package/dist/server/decode-session.js +0 -78
  404. package/dist/server/slim-middleware.d.ts +0 -23
  405. package/dist/server/slim-middleware.js +0 -89
  406. package/dist/server/with-auth.d.ts +0 -33
  407. package/dist/server/with-auth.js +0 -59
  408. package/dist/services/signalrActivityService.d.ts +0 -44
  409. package/dist/services/signalrActivityService.js +0 -257
  410. package/dist/stores/authStore.d.ts +0 -154
  411. package/dist/stores/authStore.js +0 -1527
  412. package/dist/theme/ThemeProvider.d.ts +0 -14
  413. package/dist/theme/ThemeProvider.js +0 -28
  414. package/dist/theme/default.d.ts +0 -8
  415. package/dist/theme/default.js +0 -33
  416. package/dist/theme/index.d.ts +0 -15
  417. package/dist/theme/index.js +0 -25
  418. package/dist/theme/types.d.ts +0 -56
  419. package/dist/theme/types.js +0 -8
  420. package/dist/theme/useTheme.d.ts +0 -60
  421. package/dist/theme/useTheme.js +0 -63
  422. package/dist/theme/utils.d.ts +0 -13
  423. package/dist/theme/utils.js +0 -39
  424. package/dist/types/api.d.ts +0 -134
  425. package/dist/types/api.js +0 -44
  426. package/dist/types/auth.d.ts +0 -19
  427. package/dist/types/auth.js +0 -2
  428. package/dist/types/logging.d.ts +0 -42
  429. package/dist/types/logging.js +0 -2
  430. package/dist/types/recovery.d.ts +0 -48
  431. package/dist/types/recovery.js +0 -2
  432. package/dist/types/security.d.ts +0 -1
  433. package/dist/types/security.js +0 -2
  434. package/dist/utils/api.d.ts +0 -85
  435. package/dist/utils/api.js +0 -287
  436. package/dist/utils/circuitBreaker.d.ts +0 -43
  437. package/dist/utils/circuitBreaker.js +0 -91
  438. package/dist/utils/error-message.d.ts +0 -1
  439. package/dist/utils/error-message.js +0 -103
  440. package/dist/utils/layout/reservedSpace.d.ts +0 -59
  441. package/dist/utils/layout/reservedSpace.js +0 -102
  442. package/dist/utils/logout.d.ts +0 -14
  443. package/dist/utils/logout.js +0 -32
  444. package/dist/vibe/client.d.ts +0 -261
  445. package/dist/vibe/client.js +0 -445
  446. package/dist/vibe/enterprise-auth.d.ts +0 -106
  447. package/dist/vibe/enterprise-auth.js +0 -173
  448. package/dist/vibe/errors.d.ts +0 -83
  449. package/dist/vibe/errors.js +0 -146
  450. package/dist/vibe/generic.d.ts +0 -234
  451. package/dist/vibe/generic.js +0 -369
  452. package/dist/vibe/hooks/index.d.ts +0 -169
  453. package/dist/vibe/hooks/index.js +0 -252
  454. package/dist/vibe/index.d.ts +0 -25
  455. package/dist/vibe/index.js +0 -72
  456. package/dist/vibe/sessions.d.ts +0 -161
  457. package/dist/vibe/sessions.js +0 -391
  458. package/dist/vibe/types.d.ts +0 -353
  459. package/dist/vibe/types.js +0 -315
@@ -1,71 +0,0 @@
1
- "use strict";
2
- /**
3
- * Account Route Exports
4
- *
5
- * Provides ready-to-use route exports for all 2FA/account management endpoints.
6
- * These routes handle the complete 2FA flow with zero configuration.
7
- *
8
- * @example
9
- * ```typescript
10
- * // Import individual routes
11
- * export { POST } from '@payez/next-mvp/routes/account/masked-info';
12
- * export { POST } from '@payez/next-mvp/routes/account/send-code';
13
- * export { POST } from '@payez/next-mvp/routes/account/verify-email';
14
- * export { POST } from '@payez/next-mvp/routes/account/verify-sms';
15
- * ```
16
- *
17
- * @version 2.3.0
18
- * @since auth-ready-v2
19
- */
20
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- var desc = Object.getOwnPropertyDescriptor(m, k);
23
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
- desc = { enumerable: true, get: function() { return m[k]; } };
25
- }
26
- Object.defineProperty(o, k2, desc);
27
- }) : (function(o, m, k, k2) {
28
- if (k2 === undefined) k2 = k;
29
- o[k2] = m[k];
30
- }));
31
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
32
- Object.defineProperty(o, "default", { enumerable: true, value: v });
33
- }) : function(o, v) {
34
- o["default"] = v;
35
- });
36
- var __importStar = (this && this.__importStar) || (function () {
37
- var ownKeys = function(o) {
38
- ownKeys = Object.getOwnPropertyNames || function (o) {
39
- var ar = [];
40
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
41
- return ar;
42
- };
43
- return ownKeys(o);
44
- };
45
- return function (mod) {
46
- if (mod && mod.__esModule) return mod;
47
- var result = {};
48
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
49
- __setModuleDefault(result, mod);
50
- return result;
51
- };
52
- })();
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.updatePhonePOST = exports.verifySmsPOST = exports.verifyEmailPOST = exports.sendCodePOST = exports.maskedInfoPOST = exports.updatePhone = exports.verifySms = exports.verifyEmail = exports.sendCode = exports.maskedInfo = void 0;
55
- // Export individual route modules
56
- exports.maskedInfo = __importStar(require("./masked-info"));
57
- exports.sendCode = __importStar(require("./send-code"));
58
- exports.verifyEmail = __importStar(require("./verify-email"));
59
- exports.verifySms = __importStar(require("./verify-sms"));
60
- exports.updatePhone = __importStar(require("./update-phone"));
61
- // Re-export POST handlers for convenience (all 2FA endpoints use POST)
62
- var masked_info_1 = require("./masked-info");
63
- Object.defineProperty(exports, "maskedInfoPOST", { enumerable: true, get: function () { return masked_info_1.POST; } });
64
- var send_code_1 = require("./send-code");
65
- Object.defineProperty(exports, "sendCodePOST", { enumerable: true, get: function () { return send_code_1.POST; } });
66
- var verify_email_1 = require("./verify-email");
67
- Object.defineProperty(exports, "verifyEmailPOST", { enumerable: true, get: function () { return verify_email_1.POST; } });
68
- var verify_sms_1 = require("./verify-sms");
69
- Object.defineProperty(exports, "verifySmsPOST", { enumerable: true, get: function () { return verify_sms_1.POST; } });
70
- var update_phone_1 = require("./update-phone");
71
- Object.defineProperty(exports, "updatePhonePOST", { enumerable: true, get: function () { return update_phone_1.POST; } });
@@ -1,33 +0,0 @@
1
- /**
2
- * Ready-to-Use Masked Info Route
3
- *
4
- * Provides a pre-configured handler for fetching masked contact information
5
- * during 2FA flow. Can be imported directly into your app's API routes with
6
- * zero configuration.
7
- *
8
- * @example
9
- * ```typescript
10
- * // app/api/account/masked-info/route.ts
11
- * export { POST } from '@payez/next-mvp/routes/account/masked-info';
12
- * ```
13
- *
14
- * @version 2.3.0
15
- * @since auth-ready-v2
16
- */
17
- export { POST } from '../../api-handlers/account/masked-info';
18
- /**
19
- * Pre-configured POST handler for masked contact information
20
- *
21
- * This endpoint is typically called during the 2FA flow to display masked
22
- * email/phone options to the user.
23
- *
24
- * Environment variables used:
25
- * - IDP_URL or NEXT_PUBLIC_IDP_URL (default: http://localhost:32785)
26
- * - CLIENT_ID or NEXT_PUBLIC_IDP_CLIENT_ID (required)
27
- * - NEXTAUTH_SECRET (required)
28
- *
29
- * Returns:
30
- * - Masked email addresses
31
- * - Masked phone numbers
32
- * - Contact method preferences
33
- */
@@ -1,39 +0,0 @@
1
- "use strict";
2
- /**
3
- * Ready-to-Use Masked Info Route
4
- *
5
- * Provides a pre-configured handler for fetching masked contact information
6
- * during 2FA flow. Can be imported directly into your app's API routes with
7
- * zero configuration.
8
- *
9
- * @example
10
- * ```typescript
11
- * // app/api/account/masked-info/route.ts
12
- * export { POST } from '@payez/next-mvp/routes/account/masked-info';
13
- * ```
14
- *
15
- * @version 2.3.0
16
- * @since auth-ready-v2
17
- */
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.POST = void 0;
20
- // Re-export the POST handler from api-handlers
21
- // Note: IDP uses POST for masked-info endpoint
22
- var masked_info_1 = require("../../api-handlers/account/masked-info");
23
- Object.defineProperty(exports, "POST", { enumerable: true, get: function () { return masked_info_1.POST; } });
24
- /**
25
- * Pre-configured POST handler for masked contact information
26
- *
27
- * This endpoint is typically called during the 2FA flow to display masked
28
- * email/phone options to the user.
29
- *
30
- * Environment variables used:
31
- * - IDP_URL or NEXT_PUBLIC_IDP_URL (default: http://localhost:32785)
32
- * - CLIENT_ID or NEXT_PUBLIC_IDP_CLIENT_ID (required)
33
- * - NEXTAUTH_SECRET (required)
34
- *
35
- * Returns:
36
- * - Masked email addresses
37
- * - Masked phone numbers
38
- * - Contact method preferences
39
- */
@@ -1,37 +0,0 @@
1
- /**
2
- * Ready-to-Use Send Code Route
3
- *
4
- * Provides a pre-configured handler for sending 2FA verification codes
5
- * to the user's registered contact methods. Can be imported directly
6
- * into your app's API routes with zero configuration.
7
- *
8
- * @example
9
- * ```typescript
10
- * // app/api/account/send-code/route.ts
11
- * export { POST } from '@payez/next-mvp/routes/account/send-code';
12
- * ```
13
- *
14
- * @version 2.3.0
15
- * @since auth-ready-v2
16
- */
17
- export { POST } from '../../api-handlers/account/send-code';
18
- /**
19
- * Pre-configured POST handler for sending verification codes
20
- *
21
- * This endpoint triggers the IDP to send a verification code to the
22
- * user's selected contact method (email or SMS).
23
- *
24
- * Request body:
25
- * - method: 'email' | 'sms' - The contact method to use
26
- * - contactId: string - ID of the masked contact to send to
27
- *
28
- * Environment variables used:
29
- * - IDP_URL or NEXT_PUBLIC_IDP_URL (default: http://localhost:32785)
30
- * - CLIENT_ID or NEXT_PUBLIC_IDP_CLIENT_ID (required)
31
- * - NEXTAUTH_SECRET (required)
32
- *
33
- * Returns:
34
- * - Success status
35
- * - Rate limit information
36
- * - Cooldown timer if applicable
37
- */
@@ -1,42 +0,0 @@
1
- "use strict";
2
- /**
3
- * Ready-to-Use Send Code Route
4
- *
5
- * Provides a pre-configured handler for sending 2FA verification codes
6
- * to the user's registered contact methods. Can be imported directly
7
- * into your app's API routes with zero configuration.
8
- *
9
- * @example
10
- * ```typescript
11
- * // app/api/account/send-code/route.ts
12
- * export { POST } from '@payez/next-mvp/routes/account/send-code';
13
- * ```
14
- *
15
- * @version 2.3.0
16
- * @since auth-ready-v2
17
- */
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.POST = void 0;
20
- // Re-export the POST handler from api-handlers
21
- var send_code_1 = require("../../api-handlers/account/send-code");
22
- Object.defineProperty(exports, "POST", { enumerable: true, get: function () { return send_code_1.POST; } });
23
- /**
24
- * Pre-configured POST handler for sending verification codes
25
- *
26
- * This endpoint triggers the IDP to send a verification code to the
27
- * user's selected contact method (email or SMS).
28
- *
29
- * Request body:
30
- * - method: 'email' | 'sms' - The contact method to use
31
- * - contactId: string - ID of the masked contact to send to
32
- *
33
- * Environment variables used:
34
- * - IDP_URL or NEXT_PUBLIC_IDP_URL (default: http://localhost:32785)
35
- * - CLIENT_ID or NEXT_PUBLIC_IDP_CLIENT_ID (required)
36
- * - NEXTAUTH_SECRET (required)
37
- *
38
- * Returns:
39
- * - Success status
40
- * - Rate limit information
41
- * - Cooldown timer if applicable
42
- */
@@ -1,13 +0,0 @@
1
- /**
2
- * Update Phone Route
3
- *
4
- * Ready-to-use route handler for updating phone number.
5
- * Used for 2FA setup - users need to add a phone to enable SMS verification.
6
- *
7
- * @example
8
- * ```typescript
9
- * // app/api/account/update-phone/route.ts
10
- * export { POST } from '@payez/next-mvp/routes/account/update-phone';
11
- * ```
12
- */
13
- export { POST } from '../../api-handlers/account/update-phone';
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.POST = void 0;
4
- /**
5
- * Update Phone Route
6
- *
7
- * Ready-to-use route handler for updating phone number.
8
- * Used for 2FA setup - users need to add a phone to enable SMS verification.
9
- *
10
- * @example
11
- * ```typescript
12
- * // app/api/account/update-phone/route.ts
13
- * export { POST } from '@payez/next-mvp/routes/account/update-phone';
14
- * ```
15
- */
16
- var update_phone_1 = require("../../api-handlers/account/update-phone");
17
- Object.defineProperty(exports, "POST", { enumerable: true, get: function () { return update_phone_1.POST; } });
@@ -1,38 +0,0 @@
1
- /**
2
- * Ready-to-Use Verify Email Route
3
- *
4
- * Provides a pre-configured handler for verifying email-based 2FA codes.
5
- * Can be imported directly into your app's API routes with zero configuration.
6
- *
7
- * @example
8
- * ```typescript
9
- * // app/api/account/verify-email/route.ts
10
- * export { POST } from '@payez/next-mvp/routes/account/verify-email';
11
- * ```
12
- *
13
- * @version 2.3.0
14
- * @since auth-ready-v2
15
- */
16
- export { POST } from '../../api-handlers/account/verify-email';
17
- /**
18
- * Pre-configured POST handler for verifying email 2FA codes
19
- *
20
- * This endpoint verifies the code sent to the user's email address
21
- * and upgrades the provisional session to a full session.
22
- *
23
- * Request body:
24
- * - code: string - The 6-digit verification code
25
- * - emailId: string - ID of the email address used
26
- *
27
- * Environment variables used:
28
- * - IDP_URL or NEXT_PUBLIC_IDP_URL (default: http://localhost:32785)
29
- * - CLIENT_ID or NEXT_PUBLIC_IDP_CLIENT_ID (required)
30
- * - NEXTAUTH_SECRET (required)
31
- *
32
- * Returns:
33
- * - Upgraded access token with MFA claim
34
- * - New refresh token
35
- * - Session upgrade status
36
- * - AMR (Authentication Methods Reference) array
37
- * - ACR (Authentication Context Class) level
38
- */
@@ -1,43 +0,0 @@
1
- "use strict";
2
- /**
3
- * Ready-to-Use Verify Email Route
4
- *
5
- * Provides a pre-configured handler for verifying email-based 2FA codes.
6
- * Can be imported directly into your app's API routes with zero configuration.
7
- *
8
- * @example
9
- * ```typescript
10
- * // app/api/account/verify-email/route.ts
11
- * export { POST } from '@payez/next-mvp/routes/account/verify-email';
12
- * ```
13
- *
14
- * @version 2.3.0
15
- * @since auth-ready-v2
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.POST = void 0;
19
- // Re-export the POST handler from api-handlers
20
- var verify_email_1 = require("../../api-handlers/account/verify-email");
21
- Object.defineProperty(exports, "POST", { enumerable: true, get: function () { return verify_email_1.POST; } });
22
- /**
23
- * Pre-configured POST handler for verifying email 2FA codes
24
- *
25
- * This endpoint verifies the code sent to the user's email address
26
- * and upgrades the provisional session to a full session.
27
- *
28
- * Request body:
29
- * - code: string - The 6-digit verification code
30
- * - emailId: string - ID of the email address used
31
- *
32
- * Environment variables used:
33
- * - IDP_URL or NEXT_PUBLIC_IDP_URL (default: http://localhost:32785)
34
- * - CLIENT_ID or NEXT_PUBLIC_IDP_CLIENT_ID (required)
35
- * - NEXTAUTH_SECRET (required)
36
- *
37
- * Returns:
38
- * - Upgraded access token with MFA claim
39
- * - New refresh token
40
- * - Session upgrade status
41
- * - AMR (Authentication Methods Reference) array
42
- * - ACR (Authentication Context Class) level
43
- */
@@ -1,38 +0,0 @@
1
- /**
2
- * Ready-to-Use Verify SMS Route
3
- *
4
- * Provides a pre-configured handler for verifying SMS-based 2FA codes.
5
- * Can be imported directly into your app's API routes with zero configuration.
6
- *
7
- * @example
8
- * ```typescript
9
- * // app/api/account/verify-sms/route.ts
10
- * export { POST } from '@payez/next-mvp/routes/account/verify-sms';
11
- * ```
12
- *
13
- * @version 2.3.0
14
- * @since auth-ready-v2
15
- */
16
- export { POST } from '../../api-handlers/account/verify-sms';
17
- /**
18
- * Pre-configured POST handler for verifying SMS 2FA codes
19
- *
20
- * This endpoint verifies the code sent to the user's phone number
21
- * and upgrades the provisional session to a full session.
22
- *
23
- * Request body:
24
- * - code: string - The 6-digit verification code
25
- * - phoneId: string - ID of the phone number used
26
- *
27
- * Environment variables used:
28
- * - IDP_URL or NEXT_PUBLIC_IDP_URL (default: http://localhost:32785)
29
- * - CLIENT_ID or NEXT_PUBLIC_IDP_CLIENT_ID (required)
30
- * - NEXTAUTH_SECRET (required)
31
- *
32
- * Returns:
33
- * - Upgraded access token with MFA claim
34
- * - New refresh token
35
- * - Session upgrade status
36
- * - AMR (Authentication Methods Reference) array
37
- * - ACR (Authentication Context Class) level
38
- */
@@ -1,43 +0,0 @@
1
- "use strict";
2
- /**
3
- * Ready-to-Use Verify SMS Route
4
- *
5
- * Provides a pre-configured handler for verifying SMS-based 2FA codes.
6
- * Can be imported directly into your app's API routes with zero configuration.
7
- *
8
- * @example
9
- * ```typescript
10
- * // app/api/account/verify-sms/route.ts
11
- * export { POST } from '@payez/next-mvp/routes/account/verify-sms';
12
- * ```
13
- *
14
- * @version 2.3.0
15
- * @since auth-ready-v2
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.POST = void 0;
19
- // Re-export the POST handler from api-handlers
20
- var verify_sms_1 = require("../../api-handlers/account/verify-sms");
21
- Object.defineProperty(exports, "POST", { enumerable: true, get: function () { return verify_sms_1.POST; } });
22
- /**
23
- * Pre-configured POST handler for verifying SMS 2FA codes
24
- *
25
- * This endpoint verifies the code sent to the user's phone number
26
- * and upgrades the provisional session to a full session.
27
- *
28
- * Request body:
29
- * - code: string - The 6-digit verification code
30
- * - phoneId: string - ID of the phone number used
31
- *
32
- * Environment variables used:
33
- * - IDP_URL or NEXT_PUBLIC_IDP_URL (default: http://localhost:32785)
34
- * - CLIENT_ID or NEXT_PUBLIC_IDP_CLIENT_ID (required)
35
- * - NEXTAUTH_SECRET (required)
36
- *
37
- * Returns:
38
- * - Upgraded access token with MFA claim
39
- * - New refresh token
40
- * - Session upgrade status
41
- * - AMR (Authentication Methods Reference) array
42
- * - ACR (Authentication Context Class) level
43
- */
@@ -1,19 +0,0 @@
1
- /**
2
- * @payez/next-mvp Ready-to-Use Route Exports
3
- *
4
- * Pre-configured route handlers that can be imported directly
5
- * into your Next.js app with zero configuration.
6
- *
7
- * @version 2.0.0
8
- * @since auth-ready-v2
9
- */
10
- export { POST as refreshPOST } from './refresh';
11
- export { GET as sessionGET, POST as sessionPOST } from './session';
12
- export { POST as logoutPOST } from './logout';
13
- export { GET as viabilityGET } from './viability';
14
- export { GET as nextAuthGET, POST as nextAuthPOST } from './nextauth';
15
- export * as refresh from './refresh';
16
- export * as session from './session';
17
- export * as logout from './logout';
18
- export * as viability from './viability';
19
- export * as nextauth from './nextauth';
@@ -1,64 +0,0 @@
1
- "use strict";
2
- /**
3
- * @payez/next-mvp Ready-to-Use Route Exports
4
- *
5
- * Pre-configured route handlers that can be imported directly
6
- * into your Next.js app with zero configuration.
7
- *
8
- * @version 2.0.0
9
- * @since auth-ready-v2
10
- */
11
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- var desc = Object.getOwnPropertyDescriptor(m, k);
14
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
- desc = { enumerable: true, get: function() { return m[k]; } };
16
- }
17
- Object.defineProperty(o, k2, desc);
18
- }) : (function(o, m, k, k2) {
19
- if (k2 === undefined) k2 = k;
20
- o[k2] = m[k];
21
- }));
22
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
- Object.defineProperty(o, "default", { enumerable: true, value: v });
24
- }) : function(o, v) {
25
- o["default"] = v;
26
- });
27
- var __importStar = (this && this.__importStar) || (function () {
28
- var ownKeys = function(o) {
29
- ownKeys = Object.getOwnPropertyNames || function (o) {
30
- var ar = [];
31
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
- return ar;
33
- };
34
- return ownKeys(o);
35
- };
36
- return function (mod) {
37
- if (mod && mod.__esModule) return mod;
38
- var result = {};
39
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
- __setModuleDefault(result, mod);
41
- return result;
42
- };
43
- })();
44
- Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.nextauth = exports.viability = exports.logout = exports.session = exports.refresh = exports.nextAuthPOST = exports.nextAuthGET = exports.viabilityGET = exports.logoutPOST = exports.sessionPOST = exports.sessionGET = exports.refreshPOST = void 0;
46
- // Export individual route handlers
47
- var refresh_1 = require("./refresh");
48
- Object.defineProperty(exports, "refreshPOST", { enumerable: true, get: function () { return refresh_1.POST; } });
49
- var session_1 = require("./session");
50
- Object.defineProperty(exports, "sessionGET", { enumerable: true, get: function () { return session_1.GET; } });
51
- Object.defineProperty(exports, "sessionPOST", { enumerable: true, get: function () { return session_1.POST; } });
52
- var logout_1 = require("./logout");
53
- Object.defineProperty(exports, "logoutPOST", { enumerable: true, get: function () { return logout_1.POST; } });
54
- var viability_1 = require("./viability");
55
- Object.defineProperty(exports, "viabilityGET", { enumerable: true, get: function () { return viability_1.GET; } });
56
- var nextauth_1 = require("./nextauth");
57
- Object.defineProperty(exports, "nextAuthGET", { enumerable: true, get: function () { return nextauth_1.GET; } });
58
- Object.defineProperty(exports, "nextAuthPOST", { enumerable: true, get: function () { return nextauth_1.POST; } });
59
- // Also export as namespaced objects for cleaner imports
60
- exports.refresh = __importStar(require("./refresh"));
61
- exports.session = __importStar(require("./session"));
62
- exports.logout = __importStar(require("./logout"));
63
- exports.viability = __importStar(require("./viability"));
64
- exports.nextauth = __importStar(require("./nextauth"));
@@ -1,31 +0,0 @@
1
- /**
2
- * Ready-to-Use Logout Route
3
- *
4
- * Provides a pre-configured logout handler that properly cleans up
5
- * sessions and revokes tokens.
6
- *
7
- * @example
8
- * ```typescript
9
- * // app/api/auth/logout/route.ts
10
- * export { POST } from '@payez/next-mvp/routes/auth/logout';
11
- * ```
12
- *
13
- * @version 2.0.0
14
- * @since auth-ready-v2
15
- */
16
- import { NextRequest, NextResponse } from 'next/server';
17
- /**
18
- * POST /api/auth/logout - Sign out and clean up session
19
- *
20
- * Performs complete logout:
21
- * 1. Revokes tokens at IDP (if refresh token available)
22
- * 2. Deletes session from store
23
- * 3. Clears session cookies
24
- */
25
- export declare function POST(req: NextRequest): Promise<NextResponse<{
26
- success: boolean;
27
- message: string;
28
- }> | NextResponse<{
29
- error: string;
30
- details: string;
31
- }>>;
@@ -1,98 +0,0 @@
1
- "use strict";
2
- /**
3
- * Ready-to-Use Logout Route
4
- *
5
- * Provides a pre-configured logout handler that properly cleans up
6
- * sessions and revokes tokens.
7
- *
8
- * @example
9
- * ```typescript
10
- * // app/api/auth/logout/route.ts
11
- * export { POST } from '@payez/next-mvp/routes/auth/logout';
12
- * ```
13
- *
14
- * @version 2.0.0
15
- * @since auth-ready-v2
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.POST = POST;
19
- const server_1 = require("next/server");
20
- const auth_1 = require("../../server/auth");
21
- const session_store_1 = require("../../lib/session-store");
22
- const app_slug_1 = require("../../lib/app-slug");
23
- const site_logger_1 = require("../../lib/site-logger");
24
- /**
25
- * POST /api/auth/logout - Sign out and clean up session
26
- *
27
- * Performs complete logout:
28
- * 1. Revokes tokens at IDP (if refresh token available)
29
- * 2. Deletes session from store
30
- * 3. Clears session cookies
31
- */
32
- async function POST(req) {
33
- try {
34
- const session = await (0, auth_1.getSession)(req);
35
- if (!session) {
36
- // Already logged out
37
- return server_1.NextResponse.json({
38
- success: true,
39
- message: 'No active session'
40
- });
41
- }
42
- const sessionId = session.session?.token;
43
- // Delete session from store (this also removes the refresh token)
44
- if (sessionId) {
45
- try {
46
- await (0, session_store_1.deleteSession)(sessionId);
47
- console.info('[LOGOUT_ROUTE] Session deleted from store');
48
- }
49
- catch (error) {
50
- console.warn('[LOGOUT_ROUTE] Failed to delete session:', error);
51
- }
52
- }
53
- // Log logout event (fire-and-forget)
54
- const userId = session.user?.id;
55
- if (userId) {
56
- site_logger_1.siteEvents.logout({
57
- user_id: userId,
58
- session_id: sessionId,
59
- trigger: 'user',
60
- url: '/api/auth/logout',
61
- user_agent: req.headers.get('user-agent') || undefined,
62
- ip_address: (0, site_logger_1.getClientIp)(req.headers) || undefined,
63
- });
64
- }
65
- // Build response that clears session cookies
66
- const response = server_1.NextResponse.json({
67
- success: true,
68
- message: 'Logged out successfully'
69
- });
70
- // Clear NextAuth session cookies (using app-slug prefixed names)
71
- const cookieNames = [
72
- (0, app_slug_1.getSessionCookieName)(),
73
- (0, app_slug_1.getSecureSessionCookieName)(),
74
- (0, app_slug_1.getCsrfCookieName)(),
75
- (0, app_slug_1.getSecureCsrfCookieName)(),
76
- (0, app_slug_1.getCallbackUrlCookieName)(),
77
- `__Secure-${(0, app_slug_1.getCallbackUrlCookieName)()}`,
78
- ];
79
- // Clear each cookie by setting it with maxAge 0
80
- cookieNames.forEach(name => {
81
- response.cookies.set(name, '', {
82
- maxAge: 0,
83
- path: '/',
84
- httpOnly: true,
85
- secure: process.env.NODE_ENV === 'production',
86
- sameSite: 'lax'
87
- });
88
- });
89
- return response;
90
- }
91
- catch (error) {
92
- console.error('[LOGOUT_ROUTE] Error during logout:', error);
93
- return server_1.NextResponse.json({
94
- error: 'Failed to logout',
95
- details: error instanceof Error ? error.message : 'Unknown error'
96
- }, { status: 500 });
97
- }
98
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * Ready-to-Use Auth Route Handler (Better Auth)
3
- *
4
- * Provides a pre-configured Better Auth handler that uses dynamic OAuth providers
5
- * loaded from IDP at startup.
6
- *
7
- * Replaces the former NextAuth handler. The file name is kept as nextauth.ts
8
- * to avoid breaking re-exports in routes/auth/index.ts.
9
- *
10
- * @version 4.0.0 - Better Auth migration
11
- * @since better-auth-4.0
12
- */
13
- /**
14
- * GET handler for auth routes
15
- * Delegates to Better Auth instance.
16
- */
17
- export declare function GET(request: Request): Promise<Response>;
18
- /**
19
- * POST handler for auth routes
20
- * Delegates to Better Auth instance.
21
- */
22
- export declare function POST(request: Request): Promise<Response>;