@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,17 +1,17 @@
1
1
  import {
2
2
  TokenRefreshService
3
- } from "./chunk-ARXUKGZI.js";
4
- import {
5
- setTokenCookies
6
- } from "./chunk-RJGYONRO.js";
3
+ } from "./chunk-XAGPZLRK.js";
7
4
  import {
8
5
  AuthError
9
6
  } from "./chunk-5GWGARXI.js";
7
+ import {
8
+ getTokenDeliveryStrategy
9
+ } from "./chunk-63EKUOJH.js";
10
10
 
11
11
  // src/next/auth-handlers/refresh.handler.ts
12
12
  import { NextResponse } from "next/server";
13
13
  function createRefreshHandler(options) {
14
- const { dependencies, jwt, hooks, cookie } = options;
14
+ const { dependencies, jwt, hooks, cookie, tokenDelivery } = options;
15
15
  const refreshService = new TokenRefreshService({
16
16
  userRepository: dependencies.userRepository,
17
17
  jwtSecret: jwt.secret,
@@ -21,9 +21,9 @@ function createRefreshHandler(options) {
21
21
  logger: dependencies.logger
22
22
  });
23
23
  return async (request) => {
24
- var _a;
25
24
  try {
26
- const refreshToken = (_a = request.cookies.get("refresh_token")) == null ? void 0 : _a.value;
25
+ const strategy = getTokenDeliveryStrategy(tokenDelivery);
26
+ const refreshToken = await strategy.extractRefreshToken(request);
27
27
  if (!refreshToken) {
28
28
  return NextResponse.json({ success: false, error: "No refresh token" }, { status: 401 });
29
29
  }
@@ -32,12 +32,17 @@ function createRefreshHandler(options) {
32
32
  if (hookResult instanceof Response) return hookResult;
33
33
  }
34
34
  const result = await refreshService.refresh(refreshToken);
35
- const response = NextResponse.json({
36
- success: true,
37
- accessToken: result.accessToken,
38
- user: result.user
39
- });
40
- setTokenCookies(response, { accessToken: result.accessToken, refreshToken }, { secure: cookie == null ? void 0 : cookie.secure });
35
+ const response = NextResponse.json(
36
+ strategy.buildTokenResponse(
37
+ { success: true, user: result.user },
38
+ { accessToken: result.accessToken }
39
+ )
40
+ );
41
+ strategy.attachCookies(
42
+ response,
43
+ { accessToken: result.accessToken, refreshToken },
44
+ { secure: cookie == null ? void 0 : cookie.secure }
45
+ );
41
46
  return response;
42
47
  } catch (error) {
43
48
  if (error instanceof AuthError) {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-PX535BHW.js";
4
4
  import {
5
5
  getResolvedCacheConfig
6
- } from "./chunk-GORISA3L.js";
6
+ } from "./chunk-7KIM5MHV.js";
7
7
 
8
8
  // src/core/cache/cache-env.ts
9
9
  function _getNodeEnv() {
@@ -0,0 +1,125 @@
1
+ import {
2
+ AuthError
3
+ } from "./chunk-5GWGARXI.js";
4
+
5
+ // src/core/auth/password/hasher.ts
6
+ import bcrypt from "bcryptjs";
7
+ var BCRYPT_PREFIX = /^\$2[aby]\$/;
8
+ var BcryptPasswordHasher = class {
9
+ constructor(options = {}) {
10
+ this.id = "bcrypt";
11
+ var _a;
12
+ this.rounds = (_a = options.rounds) != null ? _a : 12;
13
+ }
14
+ identifies(hash) {
15
+ return BCRYPT_PREFIX.test(hash);
16
+ }
17
+ async hash(password) {
18
+ return bcrypt.hash(password, this.rounds);
19
+ }
20
+ async verify(password, hash) {
21
+ return bcrypt.compare(password, hash);
22
+ }
23
+ needsRehash(hash) {
24
+ var _a;
25
+ if (!this.identifies(hash)) return true;
26
+ const cost = Number.parseInt((_a = hash.split("$")[2]) != null ? _a : "", 10);
27
+ if (Number.isNaN(cost)) return true;
28
+ return cost < this.rounds;
29
+ }
30
+ };
31
+ var ARGON2_PREFIX = /^\$argon2(id|i|d)\$/;
32
+ var argon2Cache;
33
+ async function loadArgon2() {
34
+ var _a;
35
+ if (argon2Cache) return argon2Cache;
36
+ try {
37
+ const mod = await import("argon2");
38
+ argon2Cache = (_a = mod.default) != null ? _a : mod;
39
+ return argon2Cache;
40
+ } catch (e) {
41
+ throw new AuthError(
42
+ "argon2 package is not installed. Run `npm install argon2` to use Argon2idPasswordHasher.",
43
+ "ARGON2_NOT_INSTALLED",
44
+ 500
45
+ );
46
+ }
47
+ }
48
+ function __resetArgon2Cache() {
49
+ argon2Cache = void 0;
50
+ }
51
+ function parseArgon2Params(hash) {
52
+ const paramSegment = hash.split("$").find((s) => s.startsWith("m="));
53
+ if (!paramSegment) return null;
54
+ const params = {};
55
+ for (const kv of paramSegment.split(",")) {
56
+ const [k, v] = kv.split("=");
57
+ const n = Number.parseInt(v != null ? v : "", 10);
58
+ if (!Number.isNaN(n)) params[k] = n;
59
+ }
60
+ if (params.m === void 0 || params.t === void 0 || params.p === void 0) return null;
61
+ return { m: params.m, t: params.t, p: params.p };
62
+ }
63
+ var Argon2idPasswordHasher = class {
64
+ constructor(options = {}) {
65
+ this.id = "argon2id";
66
+ var _a, _b, _c;
67
+ this.memoryCost = (_a = options.memoryCost) != null ? _a : 19456;
68
+ this.timeCost = (_b = options.timeCost) != null ? _b : 2;
69
+ this.parallelism = (_c = options.parallelism) != null ? _c : 1;
70
+ }
71
+ identifies(hash) {
72
+ return ARGON2_PREFIX.test(hash);
73
+ }
74
+ async hash(password) {
75
+ const argon2 = await loadArgon2();
76
+ return argon2.hash(password, {
77
+ type: argon2.argon2id,
78
+ memoryCost: this.memoryCost,
79
+ timeCost: this.timeCost,
80
+ parallelism: this.parallelism
81
+ });
82
+ }
83
+ async verify(password, hash) {
84
+ const argon2 = await loadArgon2();
85
+ return argon2.verify(hash, password);
86
+ }
87
+ needsRehash(hash) {
88
+ if (!this.identifies(hash)) return true;
89
+ const params = parseArgon2Params(hash);
90
+ if (!params) return true;
91
+ return params.m < this.memoryCost || params.t < this.timeCost || params.p < this.parallelism;
92
+ }
93
+ };
94
+ var MigratingPasswordHasher = class {
95
+ constructor(options) {
96
+ var _a;
97
+ this.preferred = options.preferred;
98
+ this.legacy = (_a = options.legacy) != null ? _a : [];
99
+ }
100
+ get id() {
101
+ return this.preferred.id;
102
+ }
103
+ identifies(hash) {
104
+ return [this.preferred, ...this.legacy].some((h) => h.identifies(hash));
105
+ }
106
+ async hash(password) {
107
+ return this.preferred.hash(password);
108
+ }
109
+ async verify(password, hash) {
110
+ const hasher = [this.preferred, ...this.legacy].find((h) => h.identifies(hash));
111
+ if (!hasher) return false;
112
+ return hasher.verify(password, hash);
113
+ }
114
+ needsRehash(hash) {
115
+ if (!this.preferred.identifies(hash)) return true;
116
+ return this.preferred.needsRehash(hash);
117
+ }
118
+ };
119
+
120
+ export {
121
+ BcryptPasswordHasher,
122
+ __resetArgon2Cache,
123
+ Argon2idPasswordHasher,
124
+ MigratingPasswordHasher
125
+ };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-KG65BFPK.js";
3
+ } from "./chunk-QAIN3WNN.js";
4
4
  import {
5
5
  DEFAULT_INMEMORY_CONFIG
6
6
  } from "./chunk-O4L6RI5S.js";
7
7
  import {
8
8
  __spreadProps,
9
9
  __spreadValues
10
- } from "./chunk-ORMEWXMH.js";
10
+ } from "./chunk-N3ETBM74.js";
11
11
 
12
12
  // src/core/cache/inmemory-cache-manager.ts
13
13
  var InMemoryCacheManager = class _InMemoryCacheManager {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PasswordResetService
3
- } from "./chunk-N5VOFGF3.js";
3
+ } from "./chunk-75UDFONR.js";
4
4
 
5
5
  // src/next/auth-handlers/forgot-password.handler.ts
6
6
  import { NextResponse } from "next/server";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-KG65BFPK.js";
3
+ } from "./chunk-QAIN3WNN.js";
4
4
 
5
5
  // src/core/system/utils.ts
6
6
  import { exec } from "child_process";
@@ -2,7 +2,7 @@ import {
2
2
  logApiRequest,
3
3
  logApiResponse,
4
4
  logger
5
- } from "./chunk-KG65BFPK.js";
5
+ } from "./chunk-QAIN3WNN.js";
6
6
 
7
7
  // src/next/middleware/response-logger.ts
8
8
  var responseLoggerMiddleware = async (context, next) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearTokenCookies
3
- } from "./chunk-RJGYONRO.js";
3
+ } from "./chunk-PRPMEHRE.js";
4
4
 
5
5
  // src/next/auth-handlers/logout.handler.ts
6
6
  import { NextResponse } from "next/server";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PasswordResetService
3
- } from "./chunk-N5VOFGF3.js";
3
+ } from "./chunk-75UDFONR.js";
4
4
  import {
5
5
  AuthError
6
6
  } from "./chunk-5GWGARXI.js";
@@ -8,10 +8,11 @@ import {
8
8
  // src/next/auth-handlers/reset-password.handler.ts
9
9
  import { NextResponse } from "next/server";
10
10
  import { z } from "zod";
11
+ var withinBcryptByteLimit = (value) => new TextEncoder().encode(value).length <= 72;
11
12
  var schema = z.object({
12
13
  email: z.string().email(),
13
14
  token: z.string().min(1),
14
- password: z.string().min(8)
15
+ password: z.string().min(8).refine(withinBcryptByteLimit, { message: "Password cannot exceed 72 bytes" })
15
16
  });
16
17
  function createResetPasswordHandler(options) {
17
18
  const { dependencies } = options;
@@ -4,25 +4,78 @@ import {
4
4
  import {
5
5
  __spreadProps,
6
6
  __spreadValues
7
- } from "./chunk-ORMEWXMH.js";
7
+ } from "./chunk-N3ETBM74.js";
8
8
 
9
9
  // src/core/auth/jwt/index.ts
10
- import { SignJWT, jwtVerify } from "jose";
10
+ import { randomUUID } from "crypto";
11
+ import {
12
+ SignJWT,
13
+ jwtVerify,
14
+ importPKCS8,
15
+ importSPKI,
16
+ createRemoteJWKSet
17
+ } from "jose";
11
18
  var JWTManager = class {
12
19
  constructor(config, logger) {
13
20
  this.config = config;
14
21
  this.logger = logger;
15
- this.secretKey = new TextEncoder().encode(config.secret);
16
- if (config.secret.length < 32) {
17
- throw new JWTError("JWT secret must be at least 32 characters long", "TOKEN_CREATION_FAILED");
22
+ if (this.isSymmetric()) {
23
+ if (!config.secret || config.secret.length < 32) {
24
+ throw new JWTError("JWT secret must be at least 32 characters long", "TOKEN_CREATION_FAILED");
25
+ }
26
+ this.secretKey = new TextEncoder().encode(config.secret);
27
+ } else {
28
+ if (!config.privateKey && !config.publicKey && !config.jwksUri) {
29
+ throw new JWTError(
30
+ "Asymmetric JWT requires privateKey (sign) and/or publicKey/jwksUri (verify)",
31
+ "TOKEN_CREATION_FAILED"
32
+ );
33
+ }
34
+ }
35
+ }
36
+ isSymmetric() {
37
+ return this.config.algorithm.startsWith("HS");
38
+ }
39
+ /** 발급용 키 (HS: secret, 비대칭: PKCS#8 개인키). 결과를 캐시한다. */
40
+ async getSigningKey() {
41
+ var _a;
42
+ if (this.isSymmetric()) {
43
+ return this.secretKey;
18
44
  }
45
+ if (!this.config.privateKey) {
46
+ throw new JWTError("No privateKey configured for signing", "TOKEN_CREATION_FAILED");
47
+ }
48
+ (_a = this.signingKeyCache) != null ? _a : this.signingKeyCache = importPKCS8(this.config.privateKey, this.config.algorithm);
49
+ return this.signingKeyCache;
50
+ }
51
+ /**
52
+ * 검증용 키를 jose getKey 함수로 정규화해 반환한다 (HS: secret, 비대칭:
53
+ * SPKI 공개키 또는 원격 JWKS). 정적 키도 함수로 감싸 단일 호출 경로를 쓰며,
54
+ * jose 는 함수 호출 전 알고리즘 allowlist 를 검증하므로 confusion 가드는 유지된다.
55
+ */
56
+ async getVerifyKey() {
57
+ var _a, _b;
58
+ if (this.isSymmetric()) {
59
+ const key = this.secretKey;
60
+ return async () => key;
61
+ }
62
+ if (this.config.jwksUri) {
63
+ (_a = this.jwks) != null ? _a : this.jwks = createRemoteJWKSet(new URL(this.config.jwksUri));
64
+ return this.jwks;
65
+ }
66
+ if (this.config.publicKey) {
67
+ (_b = this.verifyKeyCache) != null ? _b : this.verifyKeyCache = importSPKI(this.config.publicKey, this.config.algorithm);
68
+ const key = await this.verifyKeyCache;
69
+ return async () => key;
70
+ }
71
+ throw new JWTError("No publicKey or jwksUri configured for verification", "TOKEN_VERIFICATION_FAILED");
19
72
  }
20
73
  /**
21
74
  * Access JWT 토큰 생성
22
75
  */
23
76
  async createAccessToken(payload) {
24
77
  try {
25
- const jwt = await new SignJWT(__spreadProps(__spreadValues({}, payload), { tokenType: "access" })).setProtectedHeader({ alg: this.config.algorithm }).setIssuedAt().setExpirationTime(this.config.accessTokenExpiry).sign(this.secretKey);
78
+ const jwt = await new SignJWT(__spreadProps(__spreadValues({}, payload), { tokenType: "access" })).setProtectedHeader({ alg: this.config.algorithm }).setIssuedAt().setExpirationTime(this.config.accessTokenExpiry).sign(await this.getSigningKey());
26
79
  this.logger.debug("Access token created successfully", {
27
80
  userId: payload.userId,
28
81
  expiresIn: this.config.accessTokenExpiry
@@ -38,14 +91,20 @@ var JWTManager = class {
38
91
  }
39
92
  /**
40
93
  * Refresh 토큰 생성
94
+ *
95
+ * rotation/reuse detection 용 `jti`(토큰 고유 id)와 `familyId`(회전 계보 id)를
96
+ * 함께 발급할 수 있다. 미지정 시 0.8 이전과 동일하게 식별자 없는 refresh
97
+ * 토큰을 만든다(하위 호환).
41
98
  */
42
- async createRefreshToken(userId) {
99
+ async createRefreshToken(userId, options) {
43
100
  try {
44
101
  const payload = {
45
102
  userId,
46
103
  tokenType: "refresh"
47
104
  };
48
- const jwt = await new SignJWT(payload).setProtectedHeader({ alg: this.config.algorithm }).setIssuedAt().setExpirationTime(this.config.refreshTokenExpiry).sign(this.secretKey);
105
+ if (options == null ? void 0 : options.jti) payload.jti = options.jti;
106
+ if (options == null ? void 0 : options.familyId) payload.familyId = options.familyId;
107
+ const jwt = await new SignJWT(payload).setProtectedHeader({ alg: this.config.algorithm }).setIssuedAt().setExpirationTime(this.config.refreshTokenExpiry).sign(await this.getSigningKey());
49
108
  this.logger.debug("Refresh token created successfully", {
50
109
  userId,
51
110
  expiresIn: this.config.refreshTokenExpiry
@@ -62,8 +121,11 @@ var JWTManager = class {
62
121
  /**
63
122
  * 토큰 쌍 생성 (Access + Refresh)
64
123
  */
65
- async createTokenPair(user) {
124
+ async createTokenPair(user, options) {
125
+ var _a, _b;
66
126
  try {
127
+ const jti = (_a = options == null ? void 0 : options.jti) != null ? _a : randomUUID();
128
+ const familyId = (_b = options == null ? void 0 : options.familyId) != null ? _b : randomUUID();
67
129
  const [accessToken, refreshToken] = await Promise.all([
68
130
  this.createAccessToken({
69
131
  id: user.id,
@@ -72,9 +134,9 @@ var JWTManager = class {
72
134
  role: user.role,
73
135
  emailVerified: user.emailVerified
74
136
  }),
75
- this.createRefreshToken(user.id)
137
+ this.createRefreshToken(user.id, { jti, familyId })
76
138
  ]);
77
- this.logger.debug("Token pair created successfully", { userId: user.id });
139
+ this.logger.debug("Token pair created successfully", { userId: user.id, familyId });
78
140
  return { accessToken, refreshToken };
79
141
  } catch (error) {
80
142
  this.logger.error("Failed to create token pair", {
@@ -89,7 +151,7 @@ var JWTManager = class {
89
151
  */
90
152
  async verifyAccessToken(token) {
91
153
  try {
92
- const { payload } = await jwtVerify(token, this.secretKey, {
154
+ const { payload } = await jwtVerify(token, await this.getVerifyKey(), {
93
155
  algorithms: [this.config.algorithm]
94
156
  });
95
157
  const userId = payload.userId || payload.sub || payload.id;
@@ -106,6 +168,8 @@ var JWTManager = class {
106
168
  id: userId,
107
169
  userId,
108
170
  email: payload.email,
171
+ // role 은 신뢰 불가 토큰에서 옴 — TRole 단언은 소비자 어휘로의 타입 편의일 뿐
172
+ // 런타임 검증은 아니다.
109
173
  role: payload.role,
110
174
  emailVerified: payload.emailVerified,
111
175
  tokenType: payload.tokenType,
@@ -131,7 +195,7 @@ var JWTManager = class {
131
195
  */
132
196
  async verifyRefreshToken(token) {
133
197
  try {
134
- const { payload } = await jwtVerify(token, this.secretKey, {
198
+ const { payload } = await jwtVerify(token, await this.getVerifyKey(), {
135
199
  algorithms: [this.config.algorithm]
136
200
  });
137
201
  const userId = payload.userId || payload.sub || payload.id;
@@ -146,7 +210,9 @@ var JWTManager = class {
146
210
  });
147
211
  return {
148
212
  userId,
149
- tokenType: payload.tokenType
213
+ tokenType: payload.tokenType,
214
+ jti: typeof payload.jti === "string" ? payload.jti : void 0,
215
+ familyId: typeof payload.familyId === "string" ? payload.familyId : void 0
150
216
  };
151
217
  } catch (error) {
152
218
  this.logger.error("Failed to verify refresh token", {
@@ -239,8 +305,8 @@ var JWTService = class {
239
305
  /**
240
306
  * Refresh 토큰 생성
241
307
  */
242
- async createRefreshToken(userId) {
243
- return this.manager.createRefreshToken(userId);
308
+ async createRefreshToken(userId, options) {
309
+ return this.manager.createRefreshToken(userId, options);
244
310
  }
245
311
  /**
246
312
  * Refresh 토큰 검증
@@ -251,8 +317,8 @@ var JWTService = class {
251
317
  /**
252
318
  * 토큰 쌍 생성
253
319
  */
254
- async createTokenPair(user) {
255
- return this.manager.createTokenPair(user);
320
+ async createTokenPair(user, options) {
321
+ return this.manager.createTokenPair(user, options);
256
322
  }
257
323
  /**
258
324
  * Access 토큰 생성
@@ -1,12 +1,13 @@
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";
10
11
 
11
12
  // src/core/auth/services/oauth-callback.service.ts
12
13
  var OAuthCallbackService = class {
@@ -47,6 +48,17 @@ var OAuthCallbackService = class {
47
48
  }
48
49
  const existingUser = await this.userRepo.findByEmail(input.email);
49
50
  if (existingUser) {
51
+ if (input.emailVerified !== true) {
52
+ this.logger.warn("Blocked OAuth account linking for unverified email", {
53
+ provider: input.provider,
54
+ userId: existingUser.id
55
+ });
56
+ throw new AuthError(
57
+ "OAuth email is not verified by the provider; cannot link to an existing account",
58
+ "OAUTH_EMAIL_NOT_VERIFIED",
59
+ 403
60
+ );
61
+ }
50
62
  await this.oauthRepo.create({
51
63
  userId: existingUser.id,
52
64
  provider: input.provider,
@@ -62,8 +74,7 @@ var OAuthCallbackService = class {
62
74
  email: input.email,
63
75
  name: input.name,
64
76
  image: input.image,
65
- emailVerified: /* @__PURE__ */ new Date()
66
- // OAuth users are auto-verified
77
+ emailVerified: input.emailVerified === true ? /* @__PURE__ */ new Date() : null
67
78
  });
68
79
  await this.oauthRepo.create({
69
80
  userId: newUser.id,
@@ -81,7 +92,7 @@ var OAuthCallbackService = class {
81
92
  return this.jwtService.createTokenPair({
82
93
  id: user.id,
83
94
  email: user.email,
84
- role: (_a = user.role) != null ? _a : "USER",
95
+ role: (_a = user.role) != null ? _a : ROLE_DEFAULTS.DEFAULT_ROLE,
85
96
  emailVerified: user.emailVerified
86
97
  });
87
98
  }
@@ -17,21 +17,8 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
20
 
33
21
  export {
34
22
  __spreadValues,
35
- __spreadProps,
36
- __objRest
23
+ __spreadProps
37
24
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JWT_DEFAULTS
3
- } from "./chunk-2SIBG5BG.js";
3
+ } from "./chunk-7YWUKMZD.js";
4
4
  import {
5
5
  configWarn
6
6
  } from "./chunk-6J2EJVND.js";
@@ -10,7 +10,7 @@ import {
10
10
 
11
11
  // src/core/auth/config.ts
12
12
  function initializeAuth(config) {
13
- var _a, _b, _c, _d;
13
+ var _a, _b, _c, _d, _e;
14
14
  (_a = globalThis.__withwiz_config) != null ? _a : globalThis.__withwiz_config = {};
15
15
  if (globalThis.__withwiz_config.auth) return;
16
16
  if (!config.jwtSecret) {
@@ -26,7 +26,8 @@ function initializeAuth(config) {
26
26
  jwtSecret: config.jwtSecret,
27
27
  accessTokenExpiry: (_b = config.accessTokenExpiry) != null ? _b : JWT_DEFAULTS.DEFAULT_ACCESS_TOKEN_EXPIRES,
28
28
  refreshTokenExpiry: (_c = config.refreshTokenExpiry) != null ? _c : JWT_DEFAULTS.DEFAULT_REFRESH_TOKEN_EXPIRES,
29
- cookieSecure: (_d = config.cookieSecure) != null ? _d : false
29
+ cookieSecure: (_d = config.cookieSecure) != null ? _d : false,
30
+ tokenDelivery: (_e = config.tokenDelivery) != null ? _e : "hybrid"
30
31
  };
31
32
  }
32
33
  function getAuthConfig() {
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  getCacheManager,
3
3
  getEffectiveCacheBackend
4
- } from "./chunk-B6L5XV7O.js";
4
+ } from "./chunk-SCAFDDJP.js";
5
5
  import {
6
6
  logger
7
- } from "./chunk-KG65BFPK.js";
7
+ } from "./chunk-QAIN3WNN.js";
8
8
  import {
9
9
  getCacheConfig,
10
10
  getCacheTTL
11
- } from "./chunk-MREY2W7N.js";
11
+ } from "./chunk-Y6CPPBJI.js";
12
12
  import {
13
13
  isCacheEnabled
14
- } from "./chunk-7F5X6F7X.js";
14
+ } from "./chunk-HV6A6Z5R.js";
15
15
 
16
16
  // src/core/cache/cache-wrapper.ts
17
17
  function getCacheBackendLabel() {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getAuthConfig
3
- } from "./chunk-KYAHURXN.js";
3
+ } from "./chunk-N3TCQ5BF.js";
4
4
  import {
5
5
  __spreadValues
6
- } from "./chunk-ORMEWXMH.js";
6
+ } from "./chunk-N3ETBM74.js";
7
7
 
8
8
  // src/core/auth/jwt/cookie.ts
9
9
  function getDefaultOptions() {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  __spreadProps,
6
6
  __spreadValues
7
- } from "./chunk-ORMEWXMH.js";
7
+ } from "./chunk-N3ETBM74.js";
8
8
 
9
9
  // src/core/logger/logger.ts
10
10
  import fs from "fs";
@@ -12,11 +12,11 @@ import {
12
12
  } from "./chunk-5GWGARXI.js";
13
13
  import {
14
14
  logger
15
- } from "./chunk-KG65BFPK.js";
15
+ } from "./chunk-QAIN3WNN.js";
16
16
  import {
17
17
  __spreadProps,
18
18
  __spreadValues
19
- } from "./chunk-ORMEWXMH.js";
19
+ } from "./chunk-N3ETBM74.js";
20
20
 
21
21
  // src/next/error/error-handler.ts
22
22
  import { NextResponse } from "next/server";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RegisterService
3
- } from "./chunk-LUIYCIF7.js";
3
+ } from "./chunk-Y4ME3Q5K.js";
4
4
  import {
5
5
  AuthError
6
6
  } from "./chunk-5GWGARXI.js";
@@ -8,9 +8,10 @@ import {
8
8
  // src/next/auth-handlers/register.handler.ts
9
9
  import { NextResponse } from "next/server";
10
10
  import { z } from "zod";
11
+ var withinBcryptByteLimit = (value) => new TextEncoder().encode(value).length <= 72;
11
12
  var registerSchema = z.object({
12
13
  email: z.string().email(),
13
- password: z.string().min(8),
14
+ password: z.string().min(8).refine(withinBcryptByteLimit, { message: "Password cannot exceed 72 bytes" }),
14
15
  name: z.string().min(1).optional()
15
16
  });
16
17
  function createRegisterHandler(options) {