@withwiz/toolkit 0.7.1 → 0.9.0

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 (399) hide show
  1. package/README.ko.md +226 -0
  2. package/README.md +66 -44
  3. package/dist/{chunk-V6YD53NH.js → chunk-23LQJYZN.js} +5 -2
  4. package/dist/chunk-2JUFL4KX.js +41 -0
  5. package/dist/{chunk-ZTRASVGZ.js → chunk-34L7HTM7.js} +1 -1
  6. package/dist/{chunk-GSUCBWML.js → chunk-3RK3MKAR.js} +5 -2
  7. package/dist/{chunk-6JXHXIEH.js → chunk-3UIKCS56.js} +2 -2
  8. package/dist/{chunk-MWBEE6VI.js → chunk-4EXZ2SDV.js} +5 -5
  9. package/dist/{chunk-MNYVAEXK.js → chunk-4ROIPF33.js} +16 -3
  10. package/dist/{chunk-JKSABDFT.js → chunk-4TGPAUJV.js} +4 -4
  11. package/dist/{chunk-D2KXIKI4.js → chunk-4XPXZNBX.js} +18 -11
  12. package/dist/{chunk-LG3KM5V3.js → chunk-5I3EQHR4.js} +6 -2
  13. package/dist/chunk-63EKUOJH.js +72 -0
  14. package/dist/chunk-6A5JHOBB.js +134 -0
  15. package/dist/{chunk-N5VOFGF3.js → chunk-75UDFONR.js} +5 -4
  16. package/dist/{chunk-GORISA3L.js → chunk-7KIM5MHV.js} +1 -1
  17. package/dist/{chunk-4L6OSSSG.js → chunk-7S2PCYNT.js} +3 -3
  18. package/dist/{chunk-2SIBG5BG.js → chunk-7YWUKMZD.js} +7 -0
  19. package/dist/{chunk-7X2N4VZM.js → chunk-ATBYGPLP.js} +1 -1
  20. package/dist/{chunk-A74POWYY.js → chunk-B7AJJKOY.js} +1 -1
  21. package/dist/{chunk-W7PEL3DX.js → chunk-BRBOGLFT.js} +4 -4
  22. package/dist/{chunk-IOUNOHP7.js → chunk-BRFW2LL2.js} +1 -1
  23. package/dist/chunk-BTYH4MHU.js +118 -0
  24. package/dist/{chunk-I4NT6G2T.js → chunk-DRTJSTEV.js} +2 -2
  25. package/dist/{chunk-JIYLTMVL.js → chunk-DVCGAI5N.js} +2 -2
  26. package/dist/chunk-E4TKORMQ.js +59 -0
  27. package/dist/{chunk-AV7ELXHG.js → chunk-E5TDIRBJ.js} +2 -2
  28. package/dist/{chunk-UBASOMP5.js → chunk-HGVPZSWW.js} +18 -13
  29. package/dist/{chunk-7F5X6F7X.js → chunk-HV6A6Z5R.js} +1 -1
  30. package/dist/chunk-ILMPKSWS.js +125 -0
  31. package/dist/{chunk-J5NLAZV2.js → chunk-JHUWZ6YW.js} +2 -2
  32. package/dist/{chunk-LON5THYQ.js → chunk-KLMKCYIN.js} +1 -1
  33. package/dist/{chunk-4KJZRI74.js → chunk-KWUOLKDO.js} +1 -1
  34. package/dist/{chunk-GJO2MPC3.js → chunk-LCYDMYZS.js} +1 -1
  35. package/dist/{chunk-WIQAPWTY.js → chunk-LL3VWKY4.js} +1 -1
  36. package/dist/{chunk-IMAFMUZ7.js → chunk-LSS3GJUE.js} +3 -2
  37. package/dist/{chunk-2PFSRVVD.js → chunk-LWHLB2Y6.js} +84 -18
  38. package/dist/{chunk-BBE4RXR7.js → chunk-MTZXWVW3.js} +17 -6
  39. package/dist/{chunk-ORMEWXMH.js → chunk-N3ETBM74.js} +1 -14
  40. package/dist/{chunk-KYAHURXN.js → chunk-N3TCQ5BF.js} +4 -3
  41. package/dist/{chunk-HX4MPCVV.js → chunk-NTZBMWB6.js} +4 -4
  42. package/dist/{chunk-RJGYONRO.js → chunk-PRPMEHRE.js} +2 -2
  43. package/dist/{chunk-KG65BFPK.js → chunk-QAIN3WNN.js} +1 -1
  44. package/dist/{chunk-JJAIVUVD.js → chunk-R7EFDSPZ.js} +2 -2
  45. package/dist/{chunk-VJE4HA2C.js → chunk-RWCPRPEP.js} +3 -2
  46. package/dist/{chunk-B6L5XV7O.js → chunk-SCAFDDJP.js} +11 -11
  47. package/dist/{chunk-KXYDTC4A.js → chunk-SNFPZD6L.js} +11 -2
  48. package/dist/{chunk-B5VRZ2VJ.js → chunk-TNDEYJEL.js} +25 -6
  49. package/dist/{chunk-GDTZMX3L.js → chunk-TRGFXIEF.js} +1 -1
  50. package/dist/{chunk-JRORMRVN.js → chunk-U2TGXJ3A.js} +1 -1
  51. package/dist/{chunk-VNDL2E44.js → chunk-U52U5SK7.js} +2 -2
  52. package/dist/{chunk-54REXMTE.js → chunk-UWOWKOOQ.js} +3 -1
  53. package/dist/{chunk-4PROUAZ5.js → chunk-V3WZFUY3.js} +7 -7
  54. package/dist/{chunk-G4LJN4OZ.js → chunk-VH57Y5Z4.js} +1 -1
  55. package/dist/chunk-VQJY52YF.js +139 -0
  56. package/dist/{chunk-5S7M2AJL.js → chunk-VWAB4PM7.js} +1 -1
  57. package/dist/{chunk-AQZPGOEZ.js → chunk-VWKZMGPJ.js} +5 -4
  58. package/dist/{chunk-4K27YLAE.js → chunk-VZ2PQA4U.js} +2 -2
  59. package/dist/{chunk-ZOWEW4GY.js → chunk-WBHX4MJV.js} +2 -2
  60. package/dist/{chunk-G4SNTXJ3.js → chunk-WSHRBK6Y.js} +7 -6
  61. package/dist/{chunk-UMRKMF3E.js → chunk-WXOWI7BJ.js} +2 -2
  62. package/dist/chunk-XAGPZLRK.js +106 -0
  63. package/dist/{chunk-VPRTPW7C.js → chunk-XF3WUF3F.js} +2 -2
  64. package/dist/{chunk-6TRD7ZW4.js → chunk-XKIBJJA3.js} +25 -21
  65. package/dist/{chunk-ZLYBY3R4.js → chunk-XTGS6JJB.js} +10 -5
  66. package/dist/{chunk-BFZR62LZ.js → chunk-XXPB4C37.js} +7 -7
  67. package/dist/{chunk-LUIYCIF7.js → chunk-Y4ME3Q5K.js} +2 -2
  68. package/dist/{chunk-Q66VOVGN.js → chunk-Y4WPEIKW.js} +1 -1
  69. package/dist/{chunk-MREY2W7N.js → chunk-Y6CPPBJI.js} +1 -1
  70. package/dist/{chunk-6TUDUOGC.js → chunk-ZEHNCHIV.js} +2 -2
  71. package/dist/{chunk-D73ZJQMX.js → chunk-ZZABL54F.js} +13 -0
  72. package/dist/core/auth/adapters/sql/dialect.d.ts +21 -0
  73. package/dist/core/auth/adapters/sql/dialect.js +11 -0
  74. package/dist/core/auth/adapters/sql/email-token-repository.d.ts +17 -0
  75. package/dist/core/auth/adapters/sql/email-token-repository.js +9 -0
  76. package/dist/core/auth/adapters/sql/index.d.ts +7 -0
  77. package/dist/core/auth/adapters/sql/index.js +27 -0
  78. package/dist/core/auth/adapters/sql/oauth-account-repository.d.ts +18 -0
  79. package/dist/core/auth/adapters/sql/oauth-account-repository.js +9 -0
  80. package/dist/core/auth/adapters/sql/types.d.ts +73 -0
  81. package/dist/core/auth/adapters/sql/types.js +7 -0
  82. package/dist/core/auth/adapters/sql/user-repository.d.ts +20 -0
  83. package/dist/core/auth/adapters/sql/user-repository.js +9 -0
  84. package/dist/core/auth/config.d.ts +3 -0
  85. package/dist/core/auth/config.js +3 -3
  86. package/dist/core/auth/email/index.d.ts +3 -3
  87. package/dist/core/auth/email/index.js +3 -3
  88. package/dist/core/auth/email/sender.d.ts +1 -1
  89. package/dist/core/auth/email/sender.js +2 -2
  90. package/dist/core/auth/email/token-generator.d.ts +11 -0
  91. package/dist/core/auth/email/token-generator.js +2 -2
  92. package/dist/core/auth/errors/index.js +1 -1
  93. package/dist/core/auth/index.d.ts +11 -11
  94. package/dist/core/auth/index.js +23 -15
  95. package/dist/core/auth/jwt/client.js +3 -2
  96. package/dist/core/auth/jwt/cookie.d.ts +1 -1
  97. package/dist/core/auth/jwt/cookie.js +4 -4
  98. package/dist/core/auth/jwt/index.d.ts +41 -9
  99. package/dist/core/auth/jwt/index.js +6 -6
  100. package/dist/core/auth/jwt/types.d.ts +1 -1
  101. package/dist/core/auth/jwt/types.js +1 -1
  102. package/dist/core/auth/oauth/index.d.ts +6 -6
  103. package/dist/core/auth/oauth/index.js +5 -5
  104. package/dist/core/auth/oauth/providers/github.d.ts +1 -1
  105. package/dist/core/auth/oauth/providers/github.js +1 -1
  106. package/dist/core/auth/oauth/providers/google.d.ts +1 -1
  107. package/dist/core/auth/oauth/providers/google.js +1 -1
  108. package/dist/core/auth/oauth/providers/index.d.ts +5 -5
  109. package/dist/core/auth/oauth/providers/index.js +4 -4
  110. package/dist/core/auth/oauth/providers/kakao.d.ts +1 -1
  111. package/dist/core/auth/oauth/providers/kakao.js +1 -1
  112. package/dist/core/auth/oauth/providers/meta.d.ts +1 -1
  113. package/dist/core/auth/oauth/providers/meta.js +1 -1
  114. package/dist/core/auth/oauth/providers/microsoft.d.ts +1 -1
  115. package/dist/core/auth/oauth/providers/microsoft.js +1 -1
  116. package/dist/core/auth/oauth/state-cookie.js +1 -1
  117. package/dist/core/auth/password/client-helper.d.ts +9 -9
  118. package/dist/core/auth/password/client-helper.js +5 -3
  119. package/dist/core/auth/password/hasher.d.ts +83 -0
  120. package/dist/core/auth/password/hasher.js +14 -0
  121. package/dist/core/auth/password/index.d.ts +8 -6
  122. package/dist/core/auth/password/index.js +11 -2
  123. package/dist/core/auth/services/email-verification.service.d.ts +1 -1
  124. package/dist/core/auth/services/email-verification.service.js +3 -3
  125. package/dist/core/auth/services/index.d.ts +13 -12
  126. package/dist/core/auth/services/index.js +16 -16
  127. package/dist/core/auth/services/login.service.d.ts +15 -1
  128. package/dist/core/auth/services/login.service.js +6 -6
  129. package/dist/core/auth/services/oauth-callback.service.d.ts +7 -1
  130. package/dist/core/auth/services/oauth-callback.service.js +6 -6
  131. package/dist/core/auth/services/password-reset.service.d.ts +1 -1
  132. package/dist/core/auth/services/password-reset.service.js +3 -3
  133. package/dist/core/auth/services/refresh-token-store.d.ts +39 -0
  134. package/dist/core/auth/services/register.service.d.ts +1 -1
  135. package/dist/core/auth/services/register.service.js +3 -3
  136. package/dist/core/auth/services/token-refresh.service.d.ts +27 -1
  137. package/dist/core/auth/services/token-refresh.service.js +6 -6
  138. package/dist/core/auth/token-delivery.d.ts +47 -0
  139. package/dist/core/auth/token-delivery.js +14 -0
  140. package/dist/core/auth/types/index.d.ts +38 -4
  141. package/dist/core/auth/types/index.js +1 -1
  142. package/dist/core/cache/cache-config.js +4 -4
  143. package/dist/core/cache/cache-defaults.js +1 -1
  144. package/dist/core/cache/cache-env.d.ts +3 -3
  145. package/dist/core/cache/cache-env.js +3 -3
  146. package/dist/core/cache/cache-factory.d.ts +6 -6
  147. package/dist/core/cache/cache-factory.js +11 -11
  148. package/dist/core/cache/cache-invalidation.d.ts +4 -4
  149. package/dist/core/cache/cache-invalidation.js +12 -12
  150. package/dist/core/cache/cache-redis.js +5 -5
  151. package/dist/core/cache/cache-types.js +1 -1
  152. package/dist/core/cache/cache-wrapper.d.ts +1 -1
  153. package/dist/core/cache/cache-wrapper.js +12 -12
  154. package/dist/core/cache/cache.d.ts +2 -2
  155. package/dist/core/cache/cache.js +17 -17
  156. package/dist/core/cache/config.js +2 -2
  157. package/dist/core/cache/hybrid-cache-manager.d.ts +1 -1
  158. package/dist/core/cache/hybrid-cache-manager.js +7 -7
  159. package/dist/core/cache/index.d.ts +15 -15
  160. package/dist/core/cache/index.js +17 -17
  161. package/dist/core/cache/inmemory-cache-manager.d.ts +1 -1
  162. package/dist/core/cache/inmemory-cache-manager.js +3 -3
  163. package/dist/core/cache/noop-cache-manager.d.ts +1 -1
  164. package/dist/core/cache/noop-cache-manager.js +5 -5
  165. package/dist/core/cache/redis-cache-manager.d.ts +2 -2
  166. package/dist/core/cache/redis-cache-manager.js +6 -6
  167. package/dist/core/config/common.js +1 -1
  168. package/dist/core/config/errors.js +1 -1
  169. package/dist/core/config/registry.d.ts +7 -7
  170. package/dist/core/config/registry.js +1 -1
  171. package/dist/core/config/warn.js +1 -1
  172. package/dist/core/constants/error-codes.js +1 -1
  173. package/dist/core/constants/index.d.ts +5 -5
  174. package/dist/core/constants/index.js +10 -8
  175. package/dist/core/constants/messages.js +1 -1
  176. package/dist/core/constants/pagination.js +1 -1
  177. package/dist/core/constants/security.d.ts +15 -0
  178. package/dist/core/constants/security.js +4 -2
  179. package/dist/core/constants/validation.js +1 -1
  180. package/dist/core/cors/index.js +1 -1
  181. package/dist/core/error/app-error.d.ts +2 -2
  182. package/dist/core/error/app-error.js +1 -1
  183. package/dist/core/error/extract-error-info.js +1 -1
  184. package/dist/core/error/friendly-messages-v2.d.ts +3 -3
  185. package/dist/core/error/friendly-messages-v2.js +4 -4
  186. package/dist/core/error/friendly-messages.js +1 -1
  187. package/dist/core/error/index.d.ts +6 -6
  188. package/dist/core/error/index.js +4 -4
  189. package/dist/core/error/messages/en.d.ts +1 -1
  190. package/dist/core/error/messages/en.js +1 -1
  191. package/dist/core/error/messages/index.d.ts +2 -2
  192. package/dist/core/error/messages/index.js +3 -3
  193. package/dist/core/error/messages/ko.d.ts +1 -1
  194. package/dist/core/error/messages/ko.js +1 -1
  195. package/dist/core/geolocation/batch-processor.d.ts +1 -1
  196. package/dist/core/geolocation/batch-processor.js +3 -3
  197. package/dist/core/geolocation/config.js +1 -1
  198. package/dist/core/geolocation/index.d.ts +5 -5
  199. package/dist/core/geolocation/index.js +7 -7
  200. package/dist/core/geolocation/providers/base-provider.d.ts +2 -2
  201. package/dist/core/geolocation/providers/base-provider.js +1 -1
  202. package/dist/core/geolocation/providers/index.d.ts +6 -6
  203. package/dist/core/geolocation/providers/index.js +5 -5
  204. package/dist/core/geolocation/providers/ip-api-provider.d.ts +3 -3
  205. package/dist/core/geolocation/providers/ip-api-provider.js +1 -1
  206. package/dist/core/geolocation/providers/ipapi-co-provider.d.ts +3 -3
  207. package/dist/core/geolocation/providers/ipapi-co-provider.js +1 -1
  208. package/dist/core/geolocation/providers/ipgeolocation-provider.d.ts +3 -3
  209. package/dist/core/geolocation/providers/ipgeolocation-provider.js +1 -1
  210. package/dist/core/geolocation/providers/maxmind-provider.d.ts +3 -3
  211. package/dist/core/geolocation/providers/maxmind-provider.js +1 -1
  212. package/dist/core/logger/config.js +1 -1
  213. package/dist/core/logger/logger.js +2 -2
  214. package/dist/core/storage/config.js +1 -1
  215. package/dist/core/storage/r2-storage.js +1 -1
  216. package/dist/core/system/cpu.d.ts +1 -1
  217. package/dist/core/system/cpu.js +4 -4
  218. package/dist/core/system/disk.d.ts +1 -1
  219. package/dist/core/system/disk.js +4 -4
  220. package/dist/core/system/environment.d.ts +1 -1
  221. package/dist/core/system/environment.js +7 -7
  222. package/dist/core/system/health-check.d.ts +2 -2
  223. package/dist/core/system/health-check.js +5 -5
  224. package/dist/core/system/index.d.ts +7 -7
  225. package/dist/core/system/index.js +17 -17
  226. package/dist/core/system/memory.d.ts +1 -1
  227. package/dist/core/system/memory.js +4 -4
  228. package/dist/core/system/network.d.ts +1 -1
  229. package/dist/core/system/network.js +4 -4
  230. package/dist/core/system/utils.js +3 -3
  231. package/dist/core/types/geoip.d.ts +1 -1
  232. package/dist/core/types/qr-code.js +1 -1
  233. package/dist/core/utils/error-message-formatter.js +1 -1
  234. package/dist/core/utils/format-number.js +1 -1
  235. package/dist/core/utils/index.d.ts +3 -3
  236. package/dist/core/utils/index.js +9 -9
  237. package/dist/core/utils/input-validation.js +52 -16
  238. package/dist/core/utils/ip-utils.js +1 -1
  239. package/dist/core/utils/optimistic-lock.js +1 -1
  240. package/dist/core/utils/sanitizer.js +2 -2
  241. package/dist/core/utils/short-code-generator.js +1 -1
  242. package/dist/core/utils/timezone.js +121 -14
  243. package/dist/core/utils/type-guards.js +1 -1
  244. package/dist/core/utils/url-normalizer.js +1 -1
  245. package/dist/core/validators/index.d.ts +1 -1
  246. package/dist/core/validators/index.js +2 -2
  247. package/dist/core/validators/password-validator.d.ts +3 -3
  248. package/dist/core/validators/password-validator.js +2 -2
  249. package/dist/initialize.d.ts +10 -10
  250. package/dist/initialize.js +7 -7
  251. package/dist/next/auth-handlers/forgot-password.handler.d.ts +1 -1
  252. package/dist/next/auth-handlers/forgot-password.handler.js +4 -4
  253. package/dist/next/auth-handlers/index.d.ts +11 -11
  254. package/dist/next/auth-handlers/index.js +32 -31
  255. package/dist/next/auth-handlers/login.handler.d.ts +1 -1
  256. package/dist/next/auth-handlers/login.handler.js +7 -6
  257. package/dist/next/auth-handlers/logout.handler.d.ts +1 -1
  258. package/dist/next/auth-handlers/logout.handler.js +5 -5
  259. package/dist/next/auth-handlers/me.handler.d.ts +1 -1
  260. package/dist/next/auth-handlers/me.handler.js +7 -6
  261. package/dist/next/auth-handlers/oauth-authorize.handler.d.ts +1 -1
  262. package/dist/next/auth-handlers/oauth-authorize.handler.js +4 -4
  263. package/dist/next/auth-handlers/oauth-callback.handler.d.ts +1 -1
  264. package/dist/next/auth-handlers/oauth-callback.handler.js +9 -9
  265. package/dist/next/auth-handlers/refresh.handler.d.ts +1 -1
  266. package/dist/next/auth-handlers/refresh.handler.js +8 -7
  267. package/dist/next/auth-handlers/register.handler.d.ts +1 -1
  268. package/dist/next/auth-handlers/register.handler.js +4 -4
  269. package/dist/next/auth-handlers/reset-password.handler.d.ts +1 -1
  270. package/dist/next/auth-handlers/reset-password.handler.js +4 -4
  271. package/dist/next/auth-handlers/verify-email.handler.d.ts +1 -1
  272. package/dist/next/auth-handlers/verify-email.handler.js +4 -4
  273. package/dist/next/auth-types/handler-types.d.ts +5 -1
  274. package/dist/next/auth-types/handler-types.js +13 -1
  275. package/dist/next/auth-types/index.d.ts +1 -1
  276. package/dist/next/auth-types/index.js +13 -1
  277. package/dist/next/error/error-handler.js +3 -3
  278. package/dist/next/error/index.d.ts +3 -3
  279. package/dist/next/error/index.js +9 -9
  280. package/dist/next/error/locale-detector.d.ts +1 -1
  281. package/dist/next/error/locale-detector.js +1 -1
  282. package/dist/next/middleware/auth.d.ts +3 -3
  283. package/dist/next/middleware/auth.js +8 -7
  284. package/dist/next/middleware/cors.d.ts +2 -2
  285. package/dist/next/middleware/cors.js +3 -3
  286. package/dist/next/middleware/error-handler.d.ts +1 -1
  287. package/dist/next/middleware/error-handler.js +6 -6
  288. package/dist/next/middleware/index.d.ts +11 -11
  289. package/dist/next/middleware/index.js +19 -18
  290. package/dist/next/middleware/init-request.d.ts +1 -1
  291. package/dist/next/middleware/init-request.js +1 -1
  292. package/dist/next/middleware/middleware-chain.d.ts +1 -1
  293. package/dist/next/middleware/middleware-chain.js +3 -3
  294. package/dist/next/middleware/rate-limit.d.ts +2 -2
  295. package/dist/next/middleware/rate-limit.js +3 -3
  296. package/dist/next/middleware/response-logger.d.ts +1 -1
  297. package/dist/next/middleware/response-logger.js +3 -3
  298. package/dist/next/middleware/security.d.ts +1 -1
  299. package/dist/next/middleware/security.js +3 -3
  300. package/dist/next/middleware/types.d.ts +6 -3
  301. package/dist/next/middleware/wrappers.d.ts +2 -2
  302. package/dist/next/middleware/wrappers.js +18 -17
  303. package/dist/next/utils/api-helpers.d.ts +6 -2
  304. package/dist/next/utils/api-helpers.js +3 -2
  305. package/dist/next/utils/cors.js +2 -2
  306. package/dist/next/utils/csv-export-format.js +1 -1
  307. package/dist/next/utils/csv-export.js +3 -3
  308. package/dist/next/utils/error-processor.d.ts +1 -1
  309. package/dist/next/utils/error-processor.js +3 -3
  310. package/dist/next/utils/index.d.ts +5 -5
  311. package/dist/next/utils/index.js +28 -27
  312. package/dist/prisma/auth-adapter/index.d.ts +1 -1
  313. package/dist/prisma/auth-adapter/index.js +1 -1
  314. package/package.json +96 -52
  315. package/dist/chunk-2P4N4OK2.js +0 -150
  316. package/dist/chunk-4IQWQSEV.js +0 -27
  317. package/dist/chunk-4K76HG4V.js +0 -34
  318. package/dist/chunk-7EXSMZ2O.js +0 -29
  319. package/dist/chunk-7VXRBTRF.js +0 -110
  320. package/dist/chunk-ARXUKGZI.js +0 -58
  321. package/dist/chunk-B5OH43PR.js +0 -31
  322. package/dist/chunk-BW4QO7T6.js +0 -56
  323. package/dist/chunk-EK4TL7VW.js +0 -22
  324. package/dist/chunk-ERKJJDY6.js +0 -117
  325. package/dist/chunk-G4GT4X3J.js +0 -240
  326. package/dist/chunk-GPOSTBDQ.js +0 -193
  327. package/dist/chunk-IRUFNC4L.js +0 -26
  328. package/dist/chunk-J2MAXMIP.js +0 -105
  329. package/dist/chunk-MFMQO6IS.js +0 -127
  330. package/dist/chunk-PBQGXOVX.js +0 -31
  331. package/dist/chunk-STMAKLLG.js +0 -24
  332. package/dist/chunk-WP233RH2.js +0 -80
  333. package/dist/chunk-WWOYFWFB.js +0 -137
  334. package/dist/chunk-X7FGBUA4.js +0 -117
  335. package/dist/chunk-YSPIFSDI.js +0 -136
  336. package/dist/chunk-ZCLKRGZ4.js +0 -81
  337. package/dist/react/components/ui/Alert.d.ts +0 -12
  338. package/dist/react/components/ui/Alert.js +0 -10
  339. package/dist/react/components/ui/Badge.d.ts +0 -7
  340. package/dist/react/components/ui/Badge.js +0 -8
  341. package/dist/react/components/ui/Button.d.ts +0 -7
  342. package/dist/react/components/ui/Button.js +0 -8
  343. package/dist/react/components/ui/DataTable.d.ts +0 -8
  344. package/dist/react/components/ui/DataTable.js +0 -22
  345. package/dist/react/components/ui/DomainDisplay.d.ts +0 -12
  346. package/dist/react/components/ui/DomainDisplay.js +0 -31
  347. package/dist/react/components/ui/Input.d.ts +0 -5
  348. package/dist/react/components/ui/Input.js +0 -8
  349. package/dist/react/components/ui/Label.d.ts +0 -5
  350. package/dist/react/components/ui/Label.js +0 -8
  351. package/dist/react/components/ui/Pagination.d.ts +0 -42
  352. package/dist/react/components/ui/Pagination.js +0 -20
  353. package/dist/react/components/ui/Select.d.ts +0 -15
  354. package/dist/react/components/ui/Select.js +0 -27
  355. package/dist/react/components/ui/Skeleton.d.ts +0 -6
  356. package/dist/react/components/ui/Skeleton.js +0 -8
  357. package/dist/react/components/ui/TimezoneDisplay.d.ts +0 -22
  358. package/dist/react/components/ui/TimezoneDisplay.js +0 -83
  359. package/dist/react/components/ui/Tooltip.d.ts +0 -21
  360. package/dist/react/components/ui/Tooltip.js +0 -94
  361. package/dist/react/components/ui/data-table/DataTable.d.ts +0 -2
  362. package/dist/react/components/ui/data-table/DataTable.js +0 -22
  363. package/dist/react/components/ui/data-table/DataTableBody.d.ts +0 -19
  364. package/dist/react/components/ui/data-table/DataTableBody.js +0 -10
  365. package/dist/react/components/ui/data-table/DataTableBulkActions.d.ts +0 -17
  366. package/dist/react/components/ui/data-table/DataTableBulkActions.js +0 -12
  367. package/dist/react/components/ui/data-table/DataTableFilters.d.ts +0 -15
  368. package/dist/react/components/ui/data-table/DataTableFilters.js +0 -13
  369. package/dist/react/components/ui/data-table/DataTablePagination.d.ts +0 -10
  370. package/dist/react/components/ui/data-table/DataTablePagination.js +0 -11
  371. package/dist/react/components/ui/data-table/DataTableSearch.d.ts +0 -24
  372. package/dist/react/components/ui/data-table/DataTableSearch.js +0 -12
  373. package/dist/react/components/ui/data-table/index.d.ts +0 -13
  374. package/dist/react/components/ui/data-table/index.js +0 -42
  375. package/dist/react/components/ui/data-table/types.d.ts +0 -120
  376. package/dist/react/components/ui/data-table/types.js +0 -9
  377. package/dist/react/components/ui/loading-bar.d.ts +0 -20
  378. package/dist/react/components/ui/loading-bar.js +0 -15
  379. package/dist/react/error/error-display.d.ts +0 -48
  380. package/dist/react/error/error-display.js +0 -30
  381. package/dist/react/error/index.d.ts +0 -6
  382. package/dist/react/error/index.js +0 -30
  383. package/dist/react/hooks/useDataTable.d.ts +0 -96
  384. package/dist/react/hooks/useDataTable.js +0 -151
  385. package/dist/react/hooks/useDebounce.d.ts +0 -7
  386. package/dist/react/hooks/useDebounce.js +0 -7
  387. package/dist/react/hooks/useExitIntent.d.ts +0 -35
  388. package/dist/react/hooks/useExitIntent.js +0 -72
  389. package/dist/react/hooks/useTimezone.d.ts +0 -19
  390. package/dist/react/hooks/useTimezone.js +0 -11
  391. package/dist/react/utils/client-utils.d.ts +0 -3
  392. package/dist/react/utils/client-utils.js +0 -9
  393. package/dist/react/utils/qr-code.d.ts +0 -16
  394. package/dist/react/utils/qr-code.js +0 -215
  395. package/dist/{chunk-7PEVOMBO.js → chunk-AOWUPAPS.js} +0 -0
  396. package/dist/{chunk-VDRLJU6C.js → chunk-E2HYIONP.js} +3 -3
  397. package/dist/{chunk-7WG7XPXC.js → chunk-KKZCNF6U.js} +3 -3
  398. package/dist/{chunk-UQ3Z3ZAF.js → chunk-P7WHMKN5.js} +3 -3
  399. /package/dist/{chunk-M22Z2NO6.js → core/auth/services/refresh-token-store.js} +0 -0
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  NoopCacheManager
3
- } from "./chunk-VPRTPW7C.js";
3
+ } from "./chunk-XF3WUF3F.js";
4
4
  import {
5
5
  RedisCacheManager
6
- } from "./chunk-JKSABDFT.js";
6
+ } from "./chunk-4TGPAUJV.js";
7
7
  import {
8
8
  HybridCacheManager
9
- } from "./chunk-BFZR62LZ.js";
9
+ } from "./chunk-XXPB4C37.js";
10
+ import {
11
+ InMemoryCacheManager
12
+ } from "./chunk-JHUWZ6YW.js";
10
13
  import {
11
14
  isRedisAvailableNow,
12
15
  isRedisGloballyDisabled
13
- } from "./chunk-6TUDUOGC.js";
14
- import {
15
- InMemoryCacheManager
16
- } from "./chunk-J5NLAZV2.js";
16
+ } from "./chunk-ZEHNCHIV.js";
17
17
  import {
18
18
  logger
19
- } from "./chunk-KG65BFPK.js";
19
+ } from "./chunk-QAIN3WNN.js";
20
20
  import {
21
21
  getCacheConfig
22
- } from "./chunk-MREY2W7N.js";
22
+ } from "./chunk-Y6CPPBJI.js";
23
23
  import {
24
24
  getENV,
25
25
  isCacheEnabled
26
- } from "./chunk-7F5X6F7X.js";
26
+ } from "./chunk-HV6A6Z5R.js";
27
27
  import {
28
28
  isCacheConfigInitialized
29
- } from "./chunk-GORISA3L.js";
29
+ } from "./chunk-7KIM5MHV.js";
30
30
  import {
31
31
  configWarn
32
32
  } from "./chunk-6J2EJVND.js";
@@ -1,9 +1,12 @@
1
1
  import {
2
2
  __spreadValues
3
- } from "./chunk-ORMEWXMH.js";
3
+ } from "./chunk-N3ETBM74.js";
4
4
 
5
5
  // src/core/validators/password-validator.ts
6
6
  import { z } from "zod";
7
+ var BCRYPT_MAX_PASSWORD_BYTES = 72;
8
+ var utf8ByteLength = (value) => new TextEncoder().encode(value).length;
9
+ var BCRYPT_BYTE_LIMIT_MESSAGE = `Password cannot exceed ${BCRYPT_MAX_PASSWORD_BYTES} bytes`;
7
10
  var PasswordStrength = /* @__PURE__ */ ((PasswordStrength2) => {
8
11
  PasswordStrength2["VERY_WEAK"] = "very_weak";
9
12
  PasswordStrength2["WEAK"] = "weak";
@@ -25,6 +28,9 @@ var PasswordValidator = class {
25
28
  if (password.length > opts.maxLength) {
26
29
  errors.push(`Password cannot exceed ${opts.maxLength} characters`);
27
30
  }
31
+ if (utf8ByteLength(password) > BCRYPT_MAX_PASSWORD_BYTES) {
32
+ errors.push(BCRYPT_BYTE_LIMIT_MESSAGE);
33
+ }
28
34
  if (opts.requireNumber && !/\d/.test(password)) {
29
35
  errors.push("Password must contain at least one number");
30
36
  }
@@ -136,7 +142,10 @@ var PasswordValidator = class {
136
142
  if (opts.customPattern) {
137
143
  schema = schema.regex(opts.customPattern, opts.customMessage);
138
144
  }
139
- return schema;
145
+ return schema.refine(
146
+ (value) => utf8ByteLength(value) <= BCRYPT_MAX_PASSWORD_BYTES,
147
+ { message: BCRYPT_BYTE_LIMIT_MESSAGE }
148
+ );
140
149
  }
141
150
  /**
142
151
  * 비밀번호 확인 검증
@@ -1,15 +1,20 @@
1
1
  import {
2
2
  JWTService
3
- } from "./chunk-2PFSRVVD.js";
3
+ } from "./chunk-LWHLB2Y6.js";
4
4
  import {
5
5
  AuthError
6
6
  } from "./chunk-5GWGARXI.js";
7
7
  import {
8
- JWT_DEFAULTS
9
- } from "./chunk-2SIBG5BG.js";
8
+ JWT_DEFAULTS,
9
+ ROLE_DEFAULTS
10
+ } from "./chunk-7YWUKMZD.js";
11
+ import {
12
+ __spreadValues
13
+ } from "./chunk-N3ETBM74.js";
10
14
 
11
15
  // src/core/auth/services/login.service.ts
12
16
  import { compare } from "bcryptjs";
17
+ var DUMMY_PASSWORD_HASH = "$2b$12$/l4jMXYcTL.SQgNWzy1UcuSlrtLlw.GFTpWDYTficzN2kRhN/LwEO";
13
18
  var LoginService = class {
14
19
  constructor(config) {
15
20
  var _a, _b, _c;
@@ -20,6 +25,7 @@ var LoginService = class {
20
25
  refreshTokenExpiry: (_b = config.refreshTokenExpiry) != null ? _b : JWT_DEFAULTS.DEFAULT_REFRESH_TOKEN_EXPIRES,
21
26
  algorithm: JWT_DEFAULTS.ALGORITHM
22
27
  }, config.logger);
28
+ this.passwordHasher = config.passwordHasher;
23
29
  this.logger = (_c = config.logger) != null ? _c : { debug() {
24
30
  }, info() {
25
31
  }, warn() {
@@ -30,12 +36,17 @@ var LoginService = class {
30
36
  var _a;
31
37
  const user = await this.userRepo.findByEmail(email);
32
38
  if (!user) {
39
+ if (this.passwordHasher) {
40
+ await this.passwordHasher.hash(password).catch(() => void 0);
41
+ } else {
42
+ await compare(password, DUMMY_PASSWORD_HASH);
43
+ }
33
44
  throw new AuthError("Invalid credentials", "INVALID_CREDENTIALS", 401);
34
45
  }
35
46
  if (user.isActive === false) {
36
47
  throw new AuthError("Account is disabled", "ACCOUNT_DISABLED", 403);
37
48
  }
38
- const isValid = await compare(password, storedHash);
49
+ const isValid = this.passwordHasher ? await this.passwordHasher.verify(password, storedHash) : await compare(password, storedHash);
39
50
  if (!isValid) {
40
51
  this.logger.warn("Failed login attempt", { email });
41
52
  throw new AuthError("Invalid credentials", "INVALID_CREDENTIALS", 401);
@@ -43,12 +54,20 @@ var LoginService = class {
43
54
  const tokens = await this.jwtService.createTokenPair({
44
55
  id: user.id,
45
56
  email: user.email,
46
- role: (_a = user.role) != null ? _a : "USER",
57
+ role: (_a = user.role) != null ? _a : ROLE_DEFAULTS.DEFAULT_ROLE,
47
58
  emailVerified: user.emailVerified
48
59
  });
60
+ let rehashedPassword;
61
+ if (this.passwordHasher && this.passwordHasher.needsRehash(storedHash)) {
62
+ try {
63
+ rehashedPassword = await this.passwordHasher.hash(password);
64
+ } catch (error) {
65
+ this.logger.warn("Password rehash failed", { userId: user.id, error });
66
+ }
67
+ }
49
68
  await this.userRepo.updateLastLoginAt(user.id);
50
69
  this.logger.info("User logged in successfully", { userId: user.id });
51
- return { user, tokens };
70
+ return __spreadValues({ user, tokens }, rehashedPassword ? { rehashedPassword } : {});
52
71
  }
53
72
  };
54
73
 
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-XQIAXMRY.js";
7
7
  import {
8
8
  logger
9
- } from "./chunk-KG65BFPK.js";
9
+ } from "./chunk-QAIN3WNN.js";
10
10
 
11
11
  // src/next/middleware/rate-limit.ts
12
12
  var GLOBAL_KEY = "__withwiz_rateLimitAdapter__";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  OAuthManager
3
- } from "./chunk-UQ3Z3ZAF.js";
3
+ } from "./chunk-P7WHMKN5.js";
4
4
  import {
5
5
  generateOAuthState,
6
6
  setOAuthStateCookie
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  runCommand,
3
3
  runMacCommand
4
- } from "./chunk-4KJZRI74.js";
4
+ } from "./chunk-KWUOLKDO.js";
5
5
  import {
6
6
  logger
7
- } from "./chunk-KG65BFPK.js";
7
+ } from "./chunk-QAIN3WNN.js";
8
8
 
9
9
  // src/core/system/memory.ts
10
10
  import os from "os";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-7ZO5UNTJ.js";
4
4
  import {
5
5
  logger
6
- } from "./chunk-KG65BFPK.js";
6
+ } from "./chunk-QAIN3WNN.js";
7
7
 
8
8
  // src/next/middleware/cors.ts
9
9
  import { NextResponse } from "next/server";
@@ -25,6 +25,7 @@ function createCorsMiddleware(config) {
25
25
  const response2 = new NextResponse(null, { status: 204 });
26
26
  if (origin && allowedOrigins.includes(origin)) {
27
27
  response2.headers.set("Access-Control-Allow-Origin", origin);
28
+ response2.headers.append("Vary", "Origin");
28
29
  if (allowCredentials) {
29
30
  response2.headers.set("Access-Control-Allow-Credentials", "true");
30
31
  }
@@ -39,6 +40,7 @@ function createCorsMiddleware(config) {
39
40
  const response = await next();
40
41
  if (origin && allowedOrigins.includes(origin)) {
41
42
  response.headers.set("Access-Control-Allow-Origin", origin);
43
+ response.headers.append("Vary", "Origin");
42
44
  if (allowCredentials) {
43
45
  response.headers.set("Access-Control-Allow-Credentials", "true");
44
46
  }
@@ -3,27 +3,27 @@ import {
3
3
  } from "./chunk-VC2E6KYQ.js";
4
4
  import {
5
5
  MiddlewareChain
6
- } from "./chunk-UMRKMF3E.js";
6
+ } from "./chunk-WXOWI7BJ.js";
7
7
  import {
8
8
  rateLimitMiddleware
9
- } from "./chunk-GDTZMX3L.js";
9
+ } from "./chunk-TRGFXIEF.js";
10
10
  import {
11
11
  responseLoggerMiddleware
12
- } from "./chunk-GJO2MPC3.js";
12
+ } from "./chunk-LCYDMYZS.js";
13
13
  import {
14
14
  securityMiddleware
15
- } from "./chunk-Q66VOVGN.js";
15
+ } from "./chunk-Y4WPEIKW.js";
16
16
  import {
17
17
  adminMiddleware,
18
18
  authMiddleware,
19
19
  optionalAuthMiddleware
20
- } from "./chunk-6TRD7ZW4.js";
20
+ } from "./chunk-XKIBJJA3.js";
21
21
  import {
22
22
  corsMiddleware
23
- } from "./chunk-54REXMTE.js";
23
+ } from "./chunk-UWOWKOOQ.js";
24
24
  import {
25
25
  errorHandlerMiddleware
26
- } from "./chunk-W7PEL3DX.js";
26
+ } from "./chunk-BRBOGLFT.js";
27
27
 
28
28
  // src/next/middleware/wrappers.ts
29
29
  function withPublicApi(handler) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  cache,
3
3
  geoCache
4
- } from "./chunk-B6L5XV7O.js";
4
+ } from "./chunk-SCAFDDJP.js";
5
5
 
6
6
  // src/core/cache/cache-invalidation.ts
7
7
  var invalidateCache = {
@@ -0,0 +1,139 @@
1
+ import {
2
+ ParamBuilder,
3
+ columnList,
4
+ getDialect
5
+ } from "./chunk-2JUFL4KX.js";
6
+ import {
7
+ resolveConfig
8
+ } from "./chunk-E4TKORMQ.js";
9
+
10
+ // src/core/auth/adapters/sql/oauth-account-repository.ts
11
+ import { randomUUID } from "crypto";
12
+ var SqlOAuthAccountRepository = class {
13
+ constructor(exec, config) {
14
+ this.exec = exec;
15
+ this.config = resolveConfig(config);
16
+ this.dialect = getDialect(this.config.dialect);
17
+ }
18
+ get table() {
19
+ return this.dialect.quoteId(this.config.tables.oauthAccount);
20
+ }
21
+ get cols() {
22
+ return this.config.oauthColumns;
23
+ }
24
+ selectColumns() {
25
+ const c = this.cols;
26
+ return [
27
+ c.id,
28
+ c.userId,
29
+ c.provider,
30
+ c.providerAccountId,
31
+ c.accessToken,
32
+ c.refreshToken,
33
+ c.expiresAt,
34
+ c.tokenType,
35
+ c.scope,
36
+ c.createdAt,
37
+ c.updatedAt
38
+ ];
39
+ }
40
+ async findByProvider(provider, providerAccountId) {
41
+ const c = this.cols;
42
+ const pb = new ParamBuilder(this.dialect);
43
+ const sql = `SELECT ${columnList(this.selectColumns(), this.dialect)} FROM ${this.table} WHERE ${this.dialect.quoteId(c.provider)} = ${pb.add(provider)} AND ${this.dialect.quoteId(c.providerAccountId)} = ${pb.add(providerAccountId)}`;
44
+ const rows = await this.exec.query(sql, pb.params);
45
+ return rows[0] ? this.mapToOAuthAccount(rows[0]) : null;
46
+ }
47
+ async findByUserId(userId) {
48
+ const pb = new ParamBuilder(this.dialect);
49
+ const sql = `SELECT ${columnList(this.selectColumns(), this.dialect)} FROM ${this.table} WHERE ${this.dialect.quoteId(this.cols.userId)} = ${pb.add(userId)}`;
50
+ const rows = await this.exec.query(sql, pb.params);
51
+ return rows.map((r) => this.mapToOAuthAccount(r));
52
+ }
53
+ async create(data) {
54
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
55
+ const c = this.cols;
56
+ const id = randomUUID();
57
+ const now = /* @__PURE__ */ new Date();
58
+ const pb = new ParamBuilder(this.dialect);
59
+ const entries = [
60
+ [c.id, id],
61
+ [c.userId, data.userId],
62
+ [c.provider, data.provider],
63
+ [c.providerAccountId, data.providerAccountId],
64
+ [c.accessToken, (_a = data.accessToken) != null ? _a : null],
65
+ [c.refreshToken, (_b = data.refreshToken) != null ? _b : null],
66
+ [c.expiresAt, (_c = data.expiresAt) != null ? _c : null],
67
+ [c.tokenType, (_d = data.tokenType) != null ? _d : null],
68
+ [c.scope, (_e = data.scope) != null ? _e : null],
69
+ [c.createdAt, now],
70
+ [c.updatedAt, now]
71
+ ];
72
+ const colSql = entries.map(([col]) => this.dialect.quoteId(col)).join(", ");
73
+ const valSql = entries.map(([, val]) => pb.add(val)).join(", ");
74
+ const sql = `INSERT INTO ${this.table} (${colSql}) VALUES (${valSql})`;
75
+ await this.exec.query(sql, pb.params);
76
+ return {
77
+ id,
78
+ userId: data.userId,
79
+ provider: data.provider,
80
+ providerAccountId: data.providerAccountId,
81
+ accessToken: (_f = data.accessToken) != null ? _f : null,
82
+ refreshToken: (_g = data.refreshToken) != null ? _g : null,
83
+ expiresAt: (_h = data.expiresAt) != null ? _h : null,
84
+ tokenType: (_i = data.tokenType) != null ? _i : null,
85
+ scope: (_j = data.scope) != null ? _j : null,
86
+ createdAt: now,
87
+ updatedAt: now
88
+ };
89
+ }
90
+ async update(id, data) {
91
+ const c = this.cols;
92
+ const pb = new ParamBuilder(this.dialect);
93
+ const sets = [];
94
+ const assign = (col, val) => sets.push(`${this.dialect.quoteId(col)} = ${pb.add(val)}`);
95
+ if (data.accessToken !== void 0) assign(c.accessToken, data.accessToken);
96
+ if (data.refreshToken !== void 0) assign(c.refreshToken, data.refreshToken);
97
+ if (data.expiresAt !== void 0) assign(c.expiresAt, data.expiresAt);
98
+ if (data.tokenType !== void 0) assign(c.tokenType, data.tokenType);
99
+ if (data.scope !== void 0) assign(c.scope, data.scope);
100
+ assign(c.updatedAt, /* @__PURE__ */ new Date());
101
+ const sql = `UPDATE ${this.table} SET ${sets.join(", ")} WHERE ${this.dialect.quoteId(c.id)} = ${pb.add(id)}`;
102
+ await this.exec.query(sql, pb.params);
103
+ const updated = await this.selectById(id);
104
+ if (!updated) throw new Error(`OAuth account not found after update: ${id}`);
105
+ return updated;
106
+ }
107
+ async delete(id) {
108
+ const pb = new ParamBuilder(this.dialect);
109
+ const sql = `DELETE FROM ${this.table} WHERE ${this.dialect.quoteId(this.cols.id)} = ${pb.add(id)}`;
110
+ await this.exec.query(sql, pb.params);
111
+ }
112
+ async selectById(id) {
113
+ const pb = new ParamBuilder(this.dialect);
114
+ const sql = `SELECT ${columnList(this.selectColumns(), this.dialect)} FROM ${this.table} WHERE ${this.dialect.quoteId(this.cols.id)} = ${pb.add(id)}`;
115
+ const rows = await this.exec.query(sql, pb.params);
116
+ return rows[0] ? this.mapToOAuthAccount(rows[0]) : null;
117
+ }
118
+ mapToOAuthAccount(row) {
119
+ var _a, _b, _c, _d, _e, _f;
120
+ const c = this.cols;
121
+ return {
122
+ id: row[c.id],
123
+ userId: row[c.userId],
124
+ provider: row[c.provider],
125
+ providerAccountId: row[c.providerAccountId],
126
+ accessToken: (_a = row[c.accessToken]) != null ? _a : null,
127
+ refreshToken: (_b = row[c.refreshToken]) != null ? _b : null,
128
+ expiresAt: (_c = row[c.expiresAt]) != null ? _c : null,
129
+ tokenType: (_d = row[c.tokenType]) != null ? _d : null,
130
+ scope: (_e = row[c.scope]) != null ? _e : null,
131
+ createdAt: row[c.createdAt],
132
+ updatedAt: (_f = row[c.updatedAt]) != null ? _f : row[c.createdAt]
133
+ };
134
+ }
135
+ };
136
+
137
+ export {
138
+ SqlOAuthAccountRepository
139
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getErrorMessage
3
- } from "./chunk-7WG7XPXC.js";
3
+ } from "./chunk-KKZCNF6U.js";
4
4
  import {
5
5
  getErrorCategory
6
6
  } from "./chunk-XQIAXMRY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TokenGenerator
3
- } from "./chunk-D73ZJQMX.js";
3
+ } from "./chunk-ZZABL54F.js";
4
4
  import {
5
5
  AuthError
6
6
  } from "./chunk-5GWGARXI.js";
@@ -20,12 +20,13 @@ var EmailVerificationService = class {
20
20
  } };
21
21
  }
22
22
  async verify(email, token) {
23
- const tokenRecord = await this.tokenRepo.findByEmailAndToken(email, token, "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */);
23
+ const hashedToken = TokenGenerator.hash(token);
24
+ const tokenRecord = await this.tokenRepo.findByEmailAndToken(email, hashedToken, "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */);
24
25
  if (!tokenRecord || tokenRecord.expires < /* @__PURE__ */ new Date()) {
25
26
  throw new AuthError("Invalid or expired verification token", "TOKEN_INVALID", 400);
26
27
  }
27
28
  await this.userRepo.verifyEmail(email);
28
- await this.tokenRepo.delete(email, token, "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */);
29
+ await this.tokenRepo.delete(email, hashedToken, "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */);
29
30
  this.logger.info("Email verified", { email });
30
31
  }
31
32
  async resend(email) {
@@ -38,7 +39,7 @@ var EmailVerificationService = class {
38
39
  }
39
40
  const token = TokenGenerator.generate();
40
41
  const expires = new Date(Date.now() + this.tokenExpiryHours * 60 * 60 * 1e3);
41
- await this.tokenRepo.create(email, token, "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */, expires);
42
+ await this.tokenRepo.create(email, TokenGenerator.hash(token), "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */, expires);
42
43
  await this.emailSender.sendVerificationEmail(email, token);
43
44
  this.logger.info("Verification email resent", { email });
44
45
  }
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-KG65BFPK.js";
3
+ } from "./chunk-QAIN3WNN.js";
4
4
  import {
5
5
  __spreadValues
6
- } from "./chunk-ORMEWXMH.js";
6
+ } from "./chunk-N3ETBM74.js";
7
7
 
8
8
  // src/core/geolocation/batch-processor.ts
9
9
  var BatchProcessor = class {
@@ -3,10 +3,10 @@ import {
3
3
  formatBytesPerSec,
4
4
  runCommand,
5
5
  runMacCommand
6
- } from "./chunk-4KJZRI74.js";
6
+ } from "./chunk-KWUOLKDO.js";
7
7
  import {
8
8
  logger
9
- } from "./chunk-KG65BFPK.js";
9
+ } from "./chunk-QAIN3WNN.js";
10
10
 
11
11
  // src/core/system/network.ts
12
12
  async function getNetworkInfo() {
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  OAuthCallbackService
3
- } from "./chunk-BBE4RXR7.js";
3
+ } from "./chunk-MTZXWVW3.js";
4
4
  import {
5
5
  OAuthManager
6
- } from "./chunk-UQ3Z3ZAF.js";
6
+ } from "./chunk-P7WHMKN5.js";
7
7
  import {
8
8
  OAUTH_STATE_COOKIE,
9
9
  clearOAuthStateCookie,
10
10
  validateOAuthState
11
11
  } from "./chunk-JLRMET4V.js";
12
- import {
13
- setTokenCookies
14
- } from "./chunk-RJGYONRO.js";
15
12
  import {
16
13
  AuthError
17
14
  } from "./chunk-5GWGARXI.js";
15
+ import {
16
+ setTokenCookies
17
+ } from "./chunk-PRPMEHRE.js";
18
18
 
19
19
  // src/next/auth-handlers/oauth-callback.handler.ts
20
20
  import { NextResponse } from "next/server";
@@ -76,7 +76,8 @@ function createOAuthCallbackHandler(options) {
76
76
  email: userInfo.email,
77
77
  name: userInfo.name,
78
78
  image: userInfo.image,
79
- accessToken
79
+ accessToken,
80
+ emailVerified: userInfo.emailVerified
80
81
  });
81
82
  if (hooks == null ? void 0 : hooks.onAfterOAuth) await hooks.onAfterOAuth(result.user, provider, result.isNewUser);
82
83
  if (result.isNewUser && (hooks == null ? void 0 : hooks.onOAuthFirstLogin)) {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-KG65BFPK.js";
3
+ } from "./chunk-QAIN3WNN.js";
4
4
  import {
5
5
  __spreadValues
6
- } from "./chunk-ORMEWXMH.js";
6
+ } from "./chunk-N3ETBM74.js";
7
7
 
8
8
  // src/next/middleware/middleware-chain.ts
9
9
  var MiddlewareChain = class {
@@ -0,0 +1,106 @@
1
+ import {
2
+ JWTService
3
+ } from "./chunk-LWHLB2Y6.js";
4
+ import {
5
+ AuthError
6
+ } from "./chunk-5GWGARXI.js";
7
+ import {
8
+ JWT_DEFAULTS,
9
+ ROLE_DEFAULTS
10
+ } from "./chunk-7YWUKMZD.js";
11
+
12
+ // src/core/auth/services/token-refresh.service.ts
13
+ import { randomUUID } from "crypto";
14
+ var TokenRefreshService = class {
15
+ constructor(config) {
16
+ var _a, _b, _c;
17
+ this.userRepo = config.userRepository;
18
+ this.jwtService = new JWTService({
19
+ secret: config.jwtSecret,
20
+ accessTokenExpiry: (_a = config.accessTokenExpiry) != null ? _a : JWT_DEFAULTS.DEFAULT_ACCESS_TOKEN_EXPIRES,
21
+ refreshTokenExpiry: (_b = config.refreshTokenExpiry) != null ? _b : JWT_DEFAULTS.DEFAULT_REFRESH_TOKEN_EXPIRES,
22
+ algorithm: JWT_DEFAULTS.ALGORITHM
23
+ }, config.logger);
24
+ this.isTokenBlacklisted = config.isTokenBlacklisted;
25
+ this.store = config.refreshTokenStore;
26
+ this.logger = (_c = config.logger) != null ? _c : { debug() {
27
+ }, info() {
28
+ }, warn() {
29
+ }, error() {
30
+ } };
31
+ }
32
+ async refresh(refreshToken) {
33
+ var _a, _b, _c;
34
+ if (this.isTokenBlacklisted) {
35
+ const blacklisted = await this.isTokenBlacklisted(refreshToken);
36
+ if (blacklisted) {
37
+ throw new AuthError("Token has been revoked", "TOKEN_REVOKED", 401);
38
+ }
39
+ }
40
+ const { userId, jti, familyId } = await this.jwtService.verifyRefreshToken(refreshToken);
41
+ if (this.store) {
42
+ if (familyId && await this.store.isFamilyRevoked(familyId)) {
43
+ throw new AuthError("Token has been revoked", "TOKEN_REVOKED", 401);
44
+ }
45
+ if (jti && await this.store.isUsed(jti)) {
46
+ if (familyId) await this.store.revokeFamily(familyId);
47
+ this.logger.warn("Refresh token reuse detected", { userId, jti, familyId });
48
+ throw new AuthError("Refresh token reuse detected", "TOKEN_REUSE_DETECTED", 401);
49
+ }
50
+ }
51
+ const user = await this.userRepo.findById(userId);
52
+ if (!user) {
53
+ throw new AuthError("User not found", "USER_NOT_FOUND", 401);
54
+ }
55
+ if (user.isActive === false) {
56
+ throw new AuthError("Account is disabled", "ACCOUNT_DISABLED", 403);
57
+ }
58
+ const role = (_a = user.role) != null ? _a : ROLE_DEFAULTS.DEFAULT_ROLE;
59
+ const accessToken = await this.jwtService.createAccessToken({
60
+ id: user.id,
61
+ userId: user.id,
62
+ email: user.email,
63
+ role,
64
+ emailVerified: user.emailVerified
65
+ });
66
+ if (!this.store) {
67
+ return { accessToken, user: { id: user.id, email: user.email, role } };
68
+ }
69
+ const family = familyId != null ? familyId : randomUUID();
70
+ if (jti) {
71
+ await this.store.markUsed(jti, { familyId: family, userId });
72
+ }
73
+ const newJti = randomUUID();
74
+ const newRefreshToken = await this.jwtService.createRefreshToken(userId, {
75
+ jti: newJti,
76
+ familyId: family
77
+ });
78
+ await ((_c = (_b = this.store).register) == null ? void 0 : _c.call(_b, { jti: newJti, familyId: family, userId }));
79
+ return { accessToken, refreshToken: newRefreshToken, user: { id: user.id, email: user.email, role } };
80
+ }
81
+ /**
82
+ * family 전체를 즉시 무효화한다 (stateful 로그아웃 / 탈취 대응).
83
+ * store 미주입 시 동작하지 않는다.
84
+ */
85
+ async revokeFamily(familyId) {
86
+ if (!this.store) {
87
+ throw new AuthError("Refresh token store is not configured", "STORE_NOT_CONFIGURED", 500);
88
+ }
89
+ await this.store.revokeFamily(familyId);
90
+ }
91
+ /**
92
+ * refresh 토큰을 검증해 그 family 를 무효화한다 (로그아웃 핸들러용).
93
+ * 토큰에 familyId 가 없으면(레거시) 무효화할 family 가 없으므로 무시한다.
94
+ */
95
+ async revokeByToken(refreshToken) {
96
+ if (!this.store) {
97
+ throw new AuthError("Refresh token store is not configured", "STORE_NOT_CONFIGURED", 500);
98
+ }
99
+ const { familyId } = await this.jwtService.verifyRefreshToken(refreshToken);
100
+ if (familyId) await this.store.revokeFamily(familyId);
101
+ }
102
+ };
103
+
104
+ export {
105
+ TokenRefreshService
106
+ };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getCacheConfig
3
- } from "./chunk-MREY2W7N.js";
3
+ } from "./chunk-Y6CPPBJI.js";
4
4
  import {
5
5
  getENV
6
- } from "./chunk-7F5X6F7X.js";
6
+ } from "./chunk-HV6A6Z5R.js";
7
7
 
8
8
  // src/core/cache/noop-cache-manager.ts
9
9
  var NoopCacheManager = class {