faire-auth 1.0.4 → 1.1.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 (228) hide show
  1. package/dist/{adapter-factory-lKIOf2OR.mjs → adapter-factory-qPVW8x9-.mjs} +34 -36
  2. package/dist/{adapter-factory-D1I7joki.cjs → adapter-factory-u8r3oTez.cjs} +66 -68
  3. package/dist/adapters/drizzle-adapter/index.cjs +34 -40
  4. package/dist/adapters/drizzle-adapter/index.d.cts +4 -9
  5. package/dist/adapters/drizzle-adapter/index.d.mts +4 -9
  6. package/dist/adapters/drizzle-adapter/index.mjs +20 -26
  7. package/dist/adapters/index.cjs +11 -16
  8. package/dist/adapters/index.d.cts +11 -37
  9. package/dist/adapters/index.d.mts +11 -37
  10. package/dist/adapters/index.mjs +4 -13
  11. package/dist/adapters/kysely-adapter/index.cjs +270 -11
  12. package/dist/adapters/kysely-adapter/index.d.cts +9 -19
  13. package/dist/adapters/kysely-adapter/index.d.mts +9 -19
  14. package/dist/adapters/kysely-adapter/index.mjs +267 -9
  15. package/dist/adapters/memory-adapter/index.cjs +146 -9
  16. package/dist/adapters/memory-adapter/index.d.cts +4 -10
  17. package/dist/adapters/memory-adapter/index.d.mts +4 -10
  18. package/dist/adapters/memory-adapter/index.mjs +145 -9
  19. package/dist/adapters/mongodb-adapter/index.cjs +13 -21
  20. package/dist/adapters/mongodb-adapter/index.d.cts +3 -8
  21. package/dist/adapters/mongodb-adapter/index.d.mts +4 -9
  22. package/dist/adapters/mongodb-adapter/index.mjs +12 -20
  23. package/dist/adapters/prisma-adapter/index.cjs +12 -20
  24. package/dist/adapters/prisma-adapter/index.d.cts +4 -8
  25. package/dist/adapters/prisma-adapter/index.d.mts +4 -8
  26. package/dist/adapters/prisma-adapter/index.mjs +5 -13
  27. package/dist/adapters/test.cjs +86 -69
  28. package/dist/adapters/test.d.cts +7 -11
  29. package/dist/adapters/test.d.mts +7 -11
  30. package/dist/adapters/test.mjs +83 -66
  31. package/dist/api/index.cjs +3 -20
  32. package/dist/api/index.d.cts +2 -3
  33. package/dist/api/index.d.mts +2 -3
  34. package/dist/api/index.mjs +1 -20
  35. package/dist/api/middleware/index.cjs +4 -11
  36. package/dist/api/middleware/index.d.cts +3 -9
  37. package/dist/api/middleware/index.d.mts +3 -9
  38. package/dist/api/middleware/index.mjs +3 -11
  39. package/dist/{api-B4RDwBty.mjs → api-0f-F-Fi2.mjs} +292 -189
  40. package/dist/{api-CaRC1Gio.cjs → api-LjfH6hQi.cjs} +557 -452
  41. package/dist/{test-utils/bun-sqlite-dialect-BZBvHchL.cjs → bun-sqlite-dialect-BHkarnxN.cjs} +5 -9
  42. package/dist/{test-utils/bun-sqlite-dialect-BSWhhKNs.mjs → bun-sqlite-dialect-BiZBuEF6.mjs} +6 -9
  43. package/dist/client/index.cjs +8 -15
  44. package/dist/client/index.d.cts +9 -14
  45. package/dist/client/index.d.mts +9 -14
  46. package/dist/client/index.mjs +7 -15
  47. package/dist/client/lynx/index.cjs +10 -18
  48. package/dist/client/lynx/index.d.cts +402 -71
  49. package/dist/client/lynx/index.d.mts +402 -71
  50. package/dist/client/lynx/index.mjs +5 -13
  51. package/dist/client/plugins/index.cjs +3 -5
  52. package/dist/client/plugins/index.d.cts +5 -10
  53. package/dist/client/plugins/index.d.mts +5 -10
  54. package/dist/client/plugins/index.mjs +2 -4
  55. package/dist/client/react/index.cjs +6 -14
  56. package/dist/client/react/index.d.cts +402 -71
  57. package/dist/client/react/index.d.mts +402 -71
  58. package/dist/client/react/index.mjs +5 -13
  59. package/dist/client/solid/index.cjs +6 -14
  60. package/dist/client/solid/index.d.cts +393 -57
  61. package/dist/client/solid/index.d.mts +393 -57
  62. package/dist/client/solid/index.mjs +5 -13
  63. package/dist/client/svelte/index.cjs +5 -10
  64. package/dist/client/svelte/index.d.cts +400 -67
  65. package/dist/client/svelte/index.d.mts +400 -67
  66. package/dist/client/svelte/index.mjs +4 -10
  67. package/dist/client/vue/index.cjs +6 -14
  68. package/dist/client/vue/index.d.cts +401 -68
  69. package/dist/client/vue/index.d.mts +401 -68
  70. package/dist/client/vue/index.mjs +5 -13
  71. package/dist/{cookies-BTs1o992.mjs → cookies-D9aY_gJh.mjs} +25 -21
  72. package/dist/{cookies-BTl72THv.cjs → cookies-DQ52rcOy.cjs} +119 -115
  73. package/dist/crypto/index.cjs +10 -8
  74. package/dist/crypto/index.d.cts +5 -13
  75. package/dist/crypto/index.d.mts +5 -13
  76. package/dist/crypto/index.mjs +2 -5
  77. package/dist/{crypto-DH2Aa7jN.mjs → crypto-BH-hD0lJ.mjs} +7 -10
  78. package/dist/{crypto-DpSCnrTp.cjs → crypto-BITfWVwD.cjs} +24 -27
  79. package/dist/db/index.cjs +1135 -29
  80. package/dist/db/index.d.cts +1 -2
  81. package/dist/db/index.d.mts +1 -2
  82. package/dist/db/index.mjs +1115 -16
  83. package/dist/defu-D2h4S3X-.mjs +87 -0
  84. package/dist/defu-DWS5RPWt.cjs +134 -0
  85. package/dist/{email-verification-DI_0H4JC.cjs → email-verification-DOPnSgbI.cjs} +65 -71
  86. package/dist/{email-verification-C_lBu_JY.mjs → email-verification-YSR5n5lb.mjs} +23 -29
  87. package/dist/{hono-CO-zsqI-.mjs → hono-BAV2wQkK.mjs} +16 -33
  88. package/dist/hono-SVQuc5Ru.mjs +4 -0
  89. package/dist/hono-pgK4H_U1.cjs +9 -0
  90. package/dist/{hono-DnW5crl1.cjs → hono-tyFFJFdS.cjs} +42 -60
  91. package/dist/index-B86Cy0dE.d.cts +2 -0
  92. package/dist/index-B86Cy0dE.d.mts +2 -0
  93. package/dist/index.cjs +115 -150
  94. package/dist/index.d.cts +4 -5
  95. package/dist/index.d.mts +4 -5
  96. package/dist/index.mjs +45 -80
  97. package/dist/integrations/next-js.cjs +5 -9
  98. package/dist/integrations/next-js.d.cts +6 -14
  99. package/dist/integrations/next-js.d.mts +6 -14
  100. package/dist/integrations/next-js.mjs +4 -9
  101. package/dist/integrations/node.cjs +16 -14
  102. package/dist/integrations/node.d.cts +6 -14
  103. package/dist/integrations/node.d.mts +6 -14
  104. package/dist/integrations/node.mjs +15 -13
  105. package/dist/integrations/react-start.cjs +7 -11
  106. package/dist/integrations/react-start.d.cts +5 -13
  107. package/dist/integrations/react-start.d.mts +5 -13
  108. package/dist/integrations/react-start.mjs +6 -11
  109. package/dist/integrations/solid-start.cjs +3 -5
  110. package/dist/integrations/solid-start.d.cts +2 -5
  111. package/dist/integrations/solid-start.d.mts +2 -5
  112. package/dist/integrations/solid-start.mjs +2 -4
  113. package/dist/integrations/svelte-kit.cjs +6 -10
  114. package/dist/integrations/svelte-kit.d.cts +11 -23
  115. package/dist/integrations/svelte-kit.d.mts +11 -23
  116. package/dist/integrations/svelte-kit.mjs +5 -10
  117. package/dist/{ip-BjNYspCH.mjs → ip-6Lv2o42m.mjs} +4 -9
  118. package/dist/{ip-C17Qdq-G.cjs → ip-DPydExzV.cjs} +21 -27
  119. package/dist/{json--tl7Grvs.cjs → json-D3aq-nH2.cjs} +9 -13
  120. package/dist/{json-B1v2qRTQ.mjs → json-DooGMtnJ.mjs} +2 -5
  121. package/dist/{logged-CyGfp8_H.mjs → logged-B83SzMnJ.mjs} +6 -10
  122. package/dist/{logged-Dv3st5qc.cjs → logged-BIpCpnVY.cjs} +13 -18
  123. package/dist/{middleware-CE6OhDkq.mjs → middleware-Cakg4e1D.mjs} +2 -4
  124. package/dist/{middleware-CWvRH4EW.cjs → middleware-Cd-VkNxB.cjs} +17 -20
  125. package/dist/{node-sqlite-dialect-w4DAg0PH.mjs → node-sqlite-dialect-BMVOjEMh.mjs} +6 -9
  126. package/dist/{test-utils/node-sqlite-dialect-BgJqjBOu.cjs → node-sqlite-dialect-D3QPFROH.cjs} +5 -9
  127. package/dist/oauth2/index.cjs +166 -22
  128. package/dist/oauth2/index.d.cts +5 -17
  129. package/dist/oauth2/index.d.mts +5 -17
  130. package/dist/oauth2/index.mjs +156 -16
  131. package/dist/{origin-check-DjLTuZQ8.cjs → origin-check-BflGhEEN.cjs} +34 -38
  132. package/dist/{origin-check-8Gajklvh.mjs → origin-check-CRgs1M7k.mjs} +13 -16
  133. package/dist/{parser-B25ylT5u.mjs → parser-CqwvpF6l.cjs} +12 -10
  134. package/dist/{parser-B_wxvaAr.cjs → parser-DcKDjjHO.mjs} +7 -22
  135. package/dist/plugins/access/index.cjs +38 -4
  136. package/dist/plugins/access/index.d.cts +36 -2
  137. package/dist/plugins/access/index.d.mts +36 -2
  138. package/dist/plugins/access/index.mjs +36 -3
  139. package/dist/plugins/bearer/index.cjs +52 -7
  140. package/dist/plugins/bearer/index.d.cts +27 -4
  141. package/dist/plugins/bearer/index.d.mts +27 -4
  142. package/dist/plugins/bearer/index.mjs +51 -7
  143. package/dist/plugins/index.cjs +1385 -842
  144. package/dist/plugins/index.d.cts +489 -7566
  145. package/dist/plugins/index.d.mts +489 -7566
  146. package/dist/plugins/index.mjs +1118 -576
  147. package/dist/plugins/passkey/index.cjs +551 -15
  148. package/dist/plugins/passkey/index.d.cts +123 -4
  149. package/dist/plugins/passkey/index.d.mts +123 -4
  150. package/dist/plugins/passkey/index.mjs +547 -15
  151. package/dist/{chunk-BFnQceUY.mjs → rolldown-runtime-BKpuH2hG.mjs} +6 -7
  152. package/dist/{chunk-fPmz2rbM.cjs → rolldown-runtime-C_Pgydhf.cjs} +22 -24
  153. package/dist/{schema-DTIwLLmf.mjs → schema-CFCpv0tK.mjs} +3 -6
  154. package/dist/{schema-CirKflVs.cjs → schema-b-lKhMkG.cjs} +51 -55
  155. package/dist/{session-CM3rmOYF.mjs → session-BGjJgihS.mjs} +51 -74
  156. package/dist/{session-Cwrj4GfV.cjs → session-CzZSMmQC.cjs} +197 -219
  157. package/dist/shared.d.cts +1581 -0
  158. package/dist/shared.d.mts +1581 -0
  159. package/dist/social-providers/index.cjs +9 -9
  160. package/dist/social-providers/index.d.cts +1 -1
  161. package/dist/social-providers/index.d.mts +1 -1
  162. package/dist/social-providers/index.mjs +3 -5
  163. package/dist/social-providers-CjPww-qf.mjs +6 -0
  164. package/dist/social-providers-D7w_7Ym8.cjs +10 -0
  165. package/dist/{state-CvSihlVT.cjs → state-2OrNjOO-.cjs} +24 -24
  166. package/dist/{state-CQghgH9I.mjs → state-Dooeisfq.mjs} +17 -17
  167. package/dist/{bun-sqlite-dialect-DPgTzc0w.cjs → test-utils/bun-sqlite-dialect-BHkarnxN.cjs} +5 -9
  168. package/dist/{bun-sqlite-dialect-6NqeV3px.mjs → test-utils/bun-sqlite-dialect-BiZBuEF6.mjs} +6 -9
  169. package/dist/test-utils/index.cjs +8831 -7941
  170. package/dist/test-utils/index.d.cts +310 -12440
  171. package/dist/test-utils/index.d.mts +313 -12440
  172. package/dist/test-utils/index.mjs +8591 -7701
  173. package/dist/test-utils/{node-sqlite-dialect-DAQXiobH.mjs → node-sqlite-dialect-BMVOjEMh.mjs} +6 -9
  174. package/dist/{node-sqlite-dialect-DP11CB0y.cjs → test-utils/node-sqlite-dialect-D3QPFROH.cjs} +5 -9
  175. package/dist/types/index.d.cts +2 -3
  176. package/dist/types/index.d.mts +2 -3
  177. package/dist/types/index.mjs +1 -1
  178. package/dist/{url-BoUuoIwZ.mjs → url-CJtdrrUu.mjs} +12 -13
  179. package/dist/{url-Ce7CVaQD.cjs → url-DjCmCUHS.cjs} +42 -44
  180. package/dist/utils/cookies.cjs +29 -30
  181. package/dist/utils/cookies.d.cts +21 -25
  182. package/dist/utils/cookies.d.mts +20 -24
  183. package/dist/utils/cookies.mjs +2 -7
  184. package/dist/utils-C7OHyfHa.mjs +4 -0
  185. package/dist/utils-iX0Vy_UL.cjs +3 -0
  186. package/package.json +40 -30
  187. package/dist/access-BZ7-AbTM.cjs +0 -51
  188. package/dist/access-D0DRqUKC.mjs +0 -39
  189. package/dist/bearer-DDzrp5M7.cjs +0 -60
  190. package/dist/bearer-WZcs7gxL.mjs +0 -54
  191. package/dist/db-4tUsQJXd.mjs +0 -1119
  192. package/dist/db-ChMbb_U-.cjs +0 -1180
  193. package/dist/defu-BmOYq4PU.cjs +0 -34
  194. package/dist/defu-D9ZTXqlo.mjs +0 -28
  195. package/dist/hono-C14rpOEa.cjs +0 -13
  196. package/dist/hono-CoKYWnXA.mjs +0 -7
  197. package/dist/hono-D0VqxVy1.d.mts +0 -18
  198. package/dist/hono-DOM31WQz.d.cts +0 -18
  199. package/dist/index--DLiUhEn.d.mts +0 -33
  200. package/dist/index-B4bqEDYG.d.mts +0 -992
  201. package/dist/index-BDhhaE6Y.d.cts +0 -3
  202. package/dist/index-Boa0SV4h.d.cts +0 -13350
  203. package/dist/index-Bykgiq3o.d.cts +0 -13350
  204. package/dist/index-CF9iq55a.d.mts +0 -3
  205. package/dist/index-CRt_fppq.d.mts +0 -41
  206. package/dist/index-CdLyn7qP.d.cts +0 -41
  207. package/dist/index-ClFGA8tb.d.mts +0 -33
  208. package/dist/index-ClOM0wFf.d.cts +0 -992
  209. package/dist/index-CsxNfGAV.d.mts +0 -13350
  210. package/dist/index-DKnO_Zfm.d.cts +0 -992
  211. package/dist/index-DRYO4mGd.d.cts +0 -33
  212. package/dist/index-Dsua4U8w.d.cts +0 -33
  213. package/dist/index-DxXFCG2_.d.mts +0 -13350
  214. package/dist/index-gtCVvDvC.d.mts +0 -992
  215. package/dist/kysely-adapter-CtIdoHa8.mjs +0 -270
  216. package/dist/kysely-adapter-QZTx077T.cjs +0 -288
  217. package/dist/memory-adapter-17RZd5df.cjs +0 -154
  218. package/dist/memory-adapter-Dp4XdCZK.mjs +0 -148
  219. package/dist/oauth2-5RL4cVNS.cjs +0 -177
  220. package/dist/oauth2-C56wz-n9.mjs +0 -159
  221. package/dist/passkey-BTT-v5c-.cjs +0 -512
  222. package/dist/passkey-CzY_W2us.mjs +0 -505
  223. package/dist/request-1NL_1lyJ.mjs +0 -58
  224. package/dist/request-CPNlp-DK.cjs +0 -100
  225. package/dist/social-providers-B8RK5yqI.mjs +0 -9
  226. package/dist/social-providers-BmFOIIPk.cjs +0 -13
  227. package/dist/utils-44aDDP8f.cjs +0 -2
  228. package/dist/utils-D4vZd1-9.mjs +0 -4
@@ -0,0 +1,87 @@
1
+ // src/utils/request.ts
2
+ const isPromise = (value) => value != null && typeof value.then === "function";
3
+ const normaliseHeaders = (source) => {
4
+ if (source == null) return new Headers();
5
+ let result;
6
+ result = typeof source === "function" ? source() : source;
7
+ if (isPromise(result)) return result.then((h) => new Headers(h));
8
+ return new Headers(result);
9
+ };
10
+ const toHeaders = (source) => {
11
+ if (source instanceof Headers || Array.isArray(source)) return new Headers(source);
12
+ const out = new Headers();
13
+ for (const [k, v] of Object.entries(source)) if (v !== void 0) out.set(k, v);
14
+ return out;
15
+ };
16
+ const mergeHeaders = (...sources) => {
17
+ const resolved = sources.filter((v) => v !== void 0).map((src) => src == null ? {} : typeof src === "function" ? src() : src);
18
+ if (!resolved.some((r) => isPromise(r))) {
19
+ const out = new Headers();
20
+ resolved.forEach((h) => toHeaders(h).forEach((v, k) => out.set(k, v)));
21
+ return out;
22
+ }
23
+ return async () => {
24
+ const out = new Headers();
25
+ for (const r of resolved) toHeaders(isPromise(r) ? await r : r).forEach((v, k) => out.set(k, v));
26
+ return out;
27
+ };
28
+ };
29
+ const buildSearchParams = (query) => {
30
+ const searchParams = new URLSearchParams();
31
+ for (const [k, v] of Object.entries(query)) {
32
+ if (v === void 0) continue;
33
+ if (Array.isArray(v)) for (const v2 of v) searchParams.append(k, v2);
34
+ else searchParams.set(k, v);
35
+ }
36
+ return searchParams;
37
+ };
38
+ const removeIndexString = (urlString) => {
39
+ if (/^https?:\/\/[^\/]+?\/index$/.test(urlString)) return urlString.replace(/\/index$/, "/");
40
+ return urlString.replace(/\/index$/, "");
41
+ };
42
+ const replaceUrlParam = (urlString, params) => {
43
+ for (const [k, v] of Object.entries(params)) {
44
+ const reg = new RegExp("/?:" + k + "(?:{[^/]+})?\\??");
45
+ urlString = urlString.replace(reg, (substring) => v ? `${substring[0] === "/" ? "/" : ""}${v}` : "");
46
+ }
47
+ return urlString.replace(/^\/\//, "/");
48
+ };
49
+ const mergePath = (base, path) => {
50
+ if (base == null) return path;
51
+ base = base.replace(/\/+$/, "");
52
+ base = base + "/";
53
+ path = path.replace(/^\/+/, "");
54
+ return base + path;
55
+ };
56
+ const replaceUrlProtocol = (urlString, protocol) => {
57
+ switch (protocol) {
58
+ case "ws": return urlString.replace(/^https?/i, (match) => match.toLowerCase() === "https" ? "wss" : "ws");
59
+ case "http": return urlString.replace(/^wss?/i, (match) => match.toLowerCase() === "wss" ? "https" : "http");
60
+ }
61
+ };
62
+ // src/utils/defu.ts
63
+ const isPlainObject = (value) => {
64
+ if (value === null || typeof value !== "object") return false;
65
+ const prototype = Object.getPrototypeOf(value);
66
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
67
+ if (Symbol.iterator in value) return false;
68
+ if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
69
+ return true;
70
+ };
71
+ const _defu = (baseObject, defaults, namespace = ".", merger) => {
72
+ if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
73
+ const object = Object.assign({}, defaults);
74
+ for (const key in baseObject) {
75
+ if (key === "__proto__" || key === "constructor") continue;
76
+ const value = baseObject[key];
77
+ if (value === null || value === void 0) continue;
78
+ if (merger?.(object, key, value, namespace) != null) continue;
79
+ if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
80
+ else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
81
+ else object[key] = value;
82
+ }
83
+ return object;
84
+ };
85
+ const createDefu = (merger) => (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
86
+ const defu = createDefu();
87
+ export { normaliseHeaders as a, replaceUrlProtocol as c, mergePath as i, buildSearchParams as n, removeIndexString as o, mergeHeaders as r, replaceUrlParam as s, defu as t };
@@ -0,0 +1,134 @@
1
+ // src/utils/request.ts
2
+ const isPromise = (value) => value != null && typeof value.then === "function";
3
+ const normaliseHeaders = (source) => {
4
+ if (source == null) return new Headers();
5
+ let result;
6
+ result = typeof source === "function" ? source() : source;
7
+ if (isPromise(result)) return result.then((h) => new Headers(h));
8
+ return new Headers(result);
9
+ };
10
+ const toHeaders = (source) => {
11
+ if (source instanceof Headers || Array.isArray(source)) return new Headers(source);
12
+ const out = new Headers();
13
+ for (const [k, v] of Object.entries(source)) if (v !== void 0) out.set(k, v);
14
+ return out;
15
+ };
16
+ const mergeHeaders = (...sources) => {
17
+ const resolved = sources.filter((v) => v !== void 0).map((src) => src == null ? {} : typeof src === "function" ? src() : src);
18
+ if (!resolved.some((r) => isPromise(r))) {
19
+ const out = new Headers();
20
+ resolved.forEach((h) => toHeaders(h).forEach((v, k) => out.set(k, v)));
21
+ return out;
22
+ }
23
+ return async () => {
24
+ const out = new Headers();
25
+ for (const r of resolved) toHeaders(isPromise(r) ? await r : r).forEach((v, k) => out.set(k, v));
26
+ return out;
27
+ };
28
+ };
29
+ const buildSearchParams = (query) => {
30
+ const searchParams = new URLSearchParams();
31
+ for (const [k, v] of Object.entries(query)) {
32
+ if (v === void 0) continue;
33
+ if (Array.isArray(v)) for (const v2 of v) searchParams.append(k, v2);
34
+ else searchParams.set(k, v);
35
+ }
36
+ return searchParams;
37
+ };
38
+ const removeIndexString = (urlString) => {
39
+ if (/^https?:\/\/[^\/]+?\/index$/.test(urlString)) return urlString.replace(/\/index$/, "/");
40
+ return urlString.replace(/\/index$/, "");
41
+ };
42
+ const replaceUrlParam = (urlString, params) => {
43
+ for (const [k, v] of Object.entries(params)) {
44
+ const reg = new RegExp("/?:" + k + "(?:{[^/]+})?\\??");
45
+ urlString = urlString.replace(reg, (substring) => v ? `${substring[0] === "/" ? "/" : ""}${v}` : "");
46
+ }
47
+ return urlString.replace(/^\/\//, "/");
48
+ };
49
+ const mergePath = (base, path) => {
50
+ if (base == null) return path;
51
+ base = base.replace(/\/+$/, "");
52
+ base = base + "/";
53
+ path = path.replace(/^\/+/, "");
54
+ return base + path;
55
+ };
56
+ const replaceUrlProtocol = (urlString, protocol) => {
57
+ switch (protocol) {
58
+ case "ws": return urlString.replace(/^https?/i, (match) => match.toLowerCase() === "https" ? "wss" : "ws");
59
+ case "http": return urlString.replace(/^wss?/i, (match) => match.toLowerCase() === "wss" ? "https" : "http");
60
+ }
61
+ };
62
+ // src/utils/defu.ts
63
+ const isPlainObject = (value) => {
64
+ if (value === null || typeof value !== "object") return false;
65
+ const prototype = Object.getPrototypeOf(value);
66
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
67
+ if (Symbol.iterator in value) return false;
68
+ if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
69
+ return true;
70
+ };
71
+ const _defu = (baseObject, defaults, namespace = ".", merger) => {
72
+ if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
73
+ const object = Object.assign({}, defaults);
74
+ for (const key in baseObject) {
75
+ if (key === "__proto__" || key === "constructor") continue;
76
+ const value = baseObject[key];
77
+ if (value === null || value === void 0) continue;
78
+ if (merger?.(object, key, value, namespace) != null) continue;
79
+ if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
80
+ else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
81
+ else object[key] = value;
82
+ }
83
+ return object;
84
+ };
85
+ const createDefu = (merger) => (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
86
+ const defu = createDefu();
87
+ Object.defineProperty(exports, "buildSearchParams", {
88
+ enumerable: true,
89
+ get: function() {
90
+ return buildSearchParams;
91
+ }
92
+ });
93
+ Object.defineProperty(exports, "defu", {
94
+ enumerable: true,
95
+ get: function() {
96
+ return defu;
97
+ }
98
+ });
99
+ Object.defineProperty(exports, "mergeHeaders", {
100
+ enumerable: true,
101
+ get: function() {
102
+ return mergeHeaders;
103
+ }
104
+ });
105
+ Object.defineProperty(exports, "mergePath", {
106
+ enumerable: true,
107
+ get: function() {
108
+ return mergePath;
109
+ }
110
+ });
111
+ Object.defineProperty(exports, "normaliseHeaders", {
112
+ enumerable: true,
113
+ get: function() {
114
+ return normaliseHeaders;
115
+ }
116
+ });
117
+ Object.defineProperty(exports, "removeIndexString", {
118
+ enumerable: true,
119
+ get: function() {
120
+ return removeIndexString;
121
+ }
122
+ });
123
+ Object.defineProperty(exports, "replaceUrlParam", {
124
+ enumerable: true,
125
+ get: function() {
126
+ return replaceUrlParam;
127
+ }
128
+ });
129
+ Object.defineProperty(exports, "replaceUrlProtocol", {
130
+ enumerable: true,
131
+ get: function() {
132
+ return replaceUrlProtocol;
133
+ }
134
+ });
@@ -1,33 +1,30 @@
1
- const require_chunk = require('./chunk-fPmz2rbM.cjs');
2
- const require_crypto = require('./crypto-DpSCnrTp.cjs');
3
- const require_cookies = require('./cookies-BTl72THv.cjs');
4
- const require_middleware = require('./middleware-CWvRH4EW.cjs');
5
- const require_session = require('./session-Cwrj4GfV.cjs');
6
- const require_origin_check = require('./origin-check-DjLTuZQ8.cjs');
7
- let __faire_auth_core_factory = require("@faire-auth/core/factory");
8
- let __faire_auth_core_static = require("@faire-auth/core/static");
9
- let __faire_auth_core_utils = require("@faire-auth/core/utils");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C_Pgydhf.cjs");
2
+ const require_crypto = require("./crypto-BITfWVwD.cjs");
3
+ const require_cookies = require("./cookies-DQ52rcOy.cjs");
4
+ const require_middleware = require("./middleware-Cd-VkNxB.cjs");
5
+ const require_session = require("./session-CzZSMmQC.cjs");
6
+ const require_origin_check = require("./origin-check-BflGhEEN.cjs");
7
+ let _faire_auth_core_factory = require("@faire-auth/core/factory");
8
+ let _faire_auth_core_static = require("@faire-auth/core/static");
9
+ let _faire_auth_core_utils = require("@faire-auth/core/utils");
10
10
  let zod = require("zod");
11
- zod = require_chunk.__toESM(zod);
11
+ zod = require_rolldown_runtime.__toESM(zod, 1);
12
12
  let jose = require("jose");
13
13
  let jose_errors = require("jose/errors");
14
-
15
- //#region src/api/schema/email-verification.ts
14
+ // src/api/schema/email-verification.ts
16
15
  const sendVerificationEmailSchema = zod.object({
17
- email: __faire_auth_core_factory.emailSchema.openapi({ description: "The email to send the verification email to" }),
18
- callbackURL: (0, __faire_auth_core_factory.callbackURLSchema)(true).openapi({ description: "The URL to use for email verification callback" })
16
+ email: _faire_auth_core_factory.emailSchema.openapi({ description: "The email to send the verification email to" }),
17
+ callbackURL: (0, _faire_auth_core_factory.callbackURLSchema)(true).openapi({ description: "The URL to use for email verification callback" })
19
18
  });
20
19
  const verifyEmailQuerySchema = zod.object({
21
20
  token: zod.string().openapi({ description: "The token to verify the email" }),
22
- callbackURL: (0, __faire_auth_core_factory.callbackURLSchema)(true).openapi({ description: "The URL to redirect to after email verification" })
21
+ callbackURL: (0, _faire_auth_core_factory.callbackURLSchema)(true).openapi({ description: "The URL to redirect to after email verification" })
23
22
  });
24
23
  const verifyEmailTokenSchema = zod.object({
25
- email: __faire_auth_core_factory.emailSchema,
24
+ email: _faire_auth_core_factory.emailSchema,
26
25
  updateTo: zod.string().optional()
27
26
  });
28
-
29
- //#endregion
30
- //#region src/api/middleware/token-check.ts
27
+ // src/api/middleware/token-check.ts
31
28
  const onError = async (ctx, error) => {
32
29
  let code;
33
30
  if (error === "missing_token") code = 400;
@@ -38,9 +35,9 @@ const onError = async (ctx, error) => {
38
35
  return ctx.redirect(`${url}?error=${error}`, 302);
39
36
  }
40
37
  return ctx.render({
41
- success: __faire_auth_core_static.False,
38
+ success: _faire_auth_core_static.False,
42
39
  code: error.toUpperCase(),
43
- message: (0, __faire_auth_core_utils.capitalizeFirstLetter)(error.replaceAll("_", " "))
40
+ message: (0, _faire_auth_core_utils.capitalizeFirstLetter)(error.replaceAll("_", " "))
44
41
  }, code);
45
42
  };
46
43
  const verifyToken = async (token, context) => {
@@ -62,16 +59,15 @@ const verifyToken = async (token, context) => {
62
59
  const tokenCheck = (getValue, schema) => require_middleware.createMiddleware()(async (ctx, next) => {
63
60
  const token = await getValue(ctx);
64
61
  if (!token) return onError(ctx, "missing_token");
65
- const res$1 = await verifyToken(token, ctx.get("context"));
66
- if (typeof res$1 === "string") return onError(ctx, res$1);
67
- const dat = await schema.safeParseAsync(res$1.payload);
62
+ const context = ctx.get("context");
63
+ const res = await verifyToken(token, context);
64
+ if (typeof res === "string") return onError(ctx, res);
65
+ const dat = await schema.safeParseAsync(res.payload);
68
66
  if (dat.success === false) return onError(ctx, "invalid_token");
69
67
  ctx.set("token", dat.data);
70
68
  return await next();
71
69
  });
72
-
73
- //#endregion
74
- //#region src/api/routes/email-verification.ts
70
+ // src/api/routes/email-verification.ts
75
71
  const createEmailVerificationToken = async (secret, email, updateTo, expiresIn = 3600) => {
76
72
  return await (0, require_crypto.crypto_exports.signJWT)({
77
73
  email: email.toLowerCase(),
@@ -86,7 +82,7 @@ const sendVerificationEmailFn = async (ctx, user, callbackURL = encodeURICompone
86
82
  if (!options?.emailVerification?.sendVerificationEmail) {
87
83
  context.logger.error("Verification email isn't enabled.");
88
84
  return ctx.render({
89
- success: __faire_auth_core_static.False,
85
+ success: _faire_auth_core_static.False,
90
86
  message: "Verification email isn't enabled"
91
87
  }, 400);
92
88
  }
@@ -98,20 +94,20 @@ const sendVerificationEmailFn = async (ctx, user, callbackURL = encodeURICompone
98
94
  token
99
95
  }, ctx);
100
96
  };
101
- const sendVerificationEmailRoute = (0, __faire_auth_core_factory.createRoute)({
102
- operationId: __faire_auth_core_static.Routes.SEND_VERIFICATION_EMAIL,
97
+ const sendVerificationEmailRoute = (0, _faire_auth_core_factory.createRoute)({
98
+ operationId: _faire_auth_core_static.Routes.SEND_VERIFICATION_EMAIL,
103
99
  method: "post",
104
100
  path: "/send-verification-email",
105
101
  description: "Send a verification email to the user",
106
- request: (0, __faire_auth_core_factory.req)().bdy(sendVerificationEmailSchema).bld(),
107
- responses: (0, __faire_auth_core_factory.res)(__faire_auth_core_static.SCHEMAS[__faire_auth_core_static.Definitions.SUCCESS].default).err(400).zod().bld()
102
+ request: (0, _faire_auth_core_factory.req)().bdy(sendVerificationEmailSchema).bld(),
103
+ responses: (0, _faire_auth_core_factory.res)(_faire_auth_core_static.SCHEMAS[_faire_auth_core_static.Definitions.SUCCESS].default).err(400).zod().bld()
108
104
  });
109
105
  const sendVerificationEmail = require_session.createEndpoint(sendVerificationEmailRoute, (options) => async (ctx) => {
110
106
  const context = ctx.get("context");
111
107
  if (!options.emailVerification?.sendVerificationEmail) {
112
108
  context.logger.error("Verification email isn't enabled.");
113
109
  return ctx.render({
114
- success: __faire_auth_core_static.False,
110
+ success: _faire_auth_core_static.False,
115
111
  message: "Verification email isn't enabled"
116
112
  }, 400);
117
113
  }
@@ -119,29 +115,29 @@ const sendVerificationEmail = require_session.createEndpoint(sendVerificationEma
119
115
  const session = await require_session.getSessionFromCtx(ctx);
120
116
  if (session instanceof Response) {
121
117
  const user = await context.internalAdapter.findUserByEmail(email);
122
- if (!user) return ctx.render({ success: __faire_auth_core_static.True }, 200);
118
+ if (!user) return ctx.render({ success: _faire_auth_core_static.True }, 200);
123
119
  await sendVerificationEmailFn(ctx, user.user, callbackURL, options);
124
- return ctx.render({ success: __faire_auth_core_static.True }, 200);
120
+ return ctx.render({ success: _faire_auth_core_static.True }, 200);
125
121
  }
126
122
  if (session.user.emailVerified) return ctx.render({
127
- success: __faire_auth_core_static.False,
123
+ success: _faire_auth_core_static.False,
128
124
  message: "You can only send a verification email to an unverified email"
129
125
  }, 400);
130
126
  if (session.user.email !== email) return ctx.render({
131
- success: __faire_auth_core_static.False,
127
+ success: _faire_auth_core_static.False,
132
128
  message: "You can only send a verification email to your own email"
133
129
  }, 400);
134
130
  await sendVerificationEmailFn(ctx, session.user, callbackURL, options);
135
- return ctx.render({ success: __faire_auth_core_static.True }, 200);
131
+ return ctx.render({ success: _faire_auth_core_static.True }, 200);
136
132
  });
137
- const verifyEmailRoute = (0, __faire_auth_core_factory.createRoute)({
138
- operationId: __faire_auth_core_static.Routes.VERIFY_EMAIL,
133
+ const verifyEmailRoute = (0, _faire_auth_core_factory.createRoute)({
134
+ operationId: _faire_auth_core_static.Routes.VERIFY_EMAIL,
139
135
  method: "get",
140
136
  path: "/verify-email",
141
137
  description: "Verify the email of the user",
142
138
  middleware: [require_origin_check.originCheck((ctx) => ctx.req.query("callbackURL")), tokenCheck((ctx) => ctx.req.query("token"), verifyEmailTokenSchema)],
143
- request: (0, __faire_auth_core_factory.req)().qry(verifyEmailQuerySchema).bld(),
144
- responses: (0, __faire_auth_core_factory.res)(__faire_auth_core_static.SCHEMAS[__faire_auth_core_static.Definitions.TOKEN_USER].default).err(401, "Invalid or expired token").err(500).rdr("Redirect to callback URL").zod().bld()
139
+ request: (0, _faire_auth_core_factory.req)().qry(verifyEmailQuerySchema).bld(),
140
+ responses: (0, _faire_auth_core_factory.res)(_faire_auth_core_static.SCHEMAS[_faire_auth_core_static.Definitions.TOKEN_USER].default).err(401, "Invalid or expired token").err(500).rdr("Redirect to callback URL").zod().bld()
145
141
  });
146
142
  const verifyEmail = require_session.createEndpoint(verifyEmailRoute, (options) => async (ctx) => {
147
143
  const { callbackURL } = ctx.req.valid("query");
@@ -153,9 +149,9 @@ const verifyEmail = require_session.createEndpoint(verifyEmailRoute, (options) =
153
149
  return ctx.redirect(`${callbackURL}?error=${error}`, 302);
154
150
  }
155
151
  return ctx.render({
156
- success: __faire_auth_core_static.False,
152
+ success: _faire_auth_core_static.False,
157
153
  code: error.toUpperCase(),
158
- message: (0, __faire_auth_core_utils.capitalizeFirstLetter)(error.replaceAll("_", " "))
154
+ message: (0, _faire_auth_core_utils.capitalizeFirstLetter)(error.replaceAll("_", " "))
159
155
  }, 401);
160
156
  };
161
157
  const user = await context.internalAdapter.findUserByEmail(parsed.email);
@@ -163,17 +159,17 @@ const verifyEmail = require_session.createEndpoint(verifyEmailRoute, (options) =
163
159
  if (parsed.updateTo) {
164
160
  const session = await require_session.getSessionFromCtx(ctx);
165
161
  if (session instanceof Response || session.user.email !== parsed.email) return redirectOnError("unauthorized");
166
- const updatedUser$1 = await context.internalAdapter.updateUserByEmail(parsed.email, {
162
+ const updatedUser = await context.internalAdapter.updateUserByEmail(parsed.email, {
167
163
  email: parsed.updateTo,
168
164
  emailVerified: false
169
165
  });
170
- if (updatedUser$1 == null) return ctx.render({
171
- success: __faire_auth_core_static.False,
166
+ if (updatedUser == null) return ctx.render({
167
+ success: _faire_auth_core_static.False,
172
168
  message: "Failed to update user"
173
169
  }, 500);
174
170
  const newToken = await createEmailVerificationToken(context.secret, parsed.updateTo);
175
171
  if (options.emailVerification?.sendVerificationEmail) await options.emailVerification.sendVerificationEmail({
176
- user: updatedUser$1,
172
+ user: updatedUser,
177
173
  url: `${context.baseURL}/verify-email?token=${newToken}&callbackURL=${callbackURL ?? encodeURIComponent("/")}`,
178
174
  token: newToken
179
175
  }, ctx);
@@ -187,15 +183,15 @@ const verifyEmail = require_session.createEndpoint(verifyEmailRoute, (options) =
187
183
  });
188
184
  if (callbackURL != null) return ctx.redirect(callbackURL, 302);
189
185
  return ctx.render({
190
- success: __faire_auth_core_static.True,
186
+ success: _faire_auth_core_static.True,
191
187
  token: session.session.token,
192
- user: updatedUser$1
188
+ user: updatedUser
193
189
  }, 200);
194
190
  }
195
191
  if (options.emailVerification?.onEmailVerification) await options.emailVerification.onEmailVerification(user.user, ctx.req);
196
192
  const updatedUser = await context.internalAdapter.updateUserByEmail(parsed.email, { emailVerified: true });
197
193
  if (updatedUser == null) return ctx.render({
198
- success: __faire_auth_core_static.False,
194
+ success: _faire_auth_core_static.False,
199
195
  message: "Failed to update user"
200
196
  }, 500);
201
197
  if (options.emailVerification?.afterEmailVerification) await options.emailVerification.afterEmailVerification(updatedUser, ctx.req);
@@ -204,7 +200,7 @@ const verifyEmail = require_session.createEndpoint(verifyEmailRoute, (options) =
204
200
  if (currentSession instanceof Response || currentSession.user.email !== parsed.email) {
205
201
  const session = await context.internalAdapter.createSession(user.user.id);
206
202
  if (session == null) return ctx.render({
207
- success: __faire_auth_core_static.False,
203
+ success: _faire_auth_core_static.False,
208
204
  message: "Failed to create session"
209
205
  }, 500);
210
206
  await require_cookies.setSessionCookie(ctx, options, {
@@ -223,25 +219,23 @@ const verifyEmail = require_session.createEndpoint(verifyEmailRoute, (options) =
223
219
  });
224
220
  }
225
221
  if (callbackURL != null) return ctx.redirect(callbackURL, 302);
226
- return ctx.render({ success: __faire_auth_core_static.False }, 200);
222
+ return ctx.render({ success: _faire_auth_core_static.False }, 200);
227
223
  });
228
-
229
- //#endregion
230
- Object.defineProperty(exports, 'createEmailVerificationToken', {
231
- enumerable: true,
232
- get: function () {
233
- return createEmailVerificationToken;
234
- }
224
+ Object.defineProperty(exports, "createEmailVerificationToken", {
225
+ enumerable: true,
226
+ get: function() {
227
+ return createEmailVerificationToken;
228
+ }
235
229
  });
236
- Object.defineProperty(exports, 'sendVerificationEmail', {
237
- enumerable: true,
238
- get: function () {
239
- return sendVerificationEmail;
240
- }
230
+ Object.defineProperty(exports, "sendVerificationEmail", {
231
+ enumerable: true,
232
+ get: function() {
233
+ return sendVerificationEmail;
234
+ }
235
+ });
236
+ Object.defineProperty(exports, "verifyEmail", {
237
+ enumerable: true,
238
+ get: function() {
239
+ return verifyEmail;
240
+ }
241
241
  });
242
- Object.defineProperty(exports, 'verifyEmail', {
243
- enumerable: true,
244
- get: function () {
245
- return verifyEmail;
246
- }
247
- });
@@ -1,31 +1,28 @@
1
- import { n as crypto_exports } from "./crypto-DH2Aa7jN.mjs";
2
- import { y as setSessionCookie } from "./cookies-BTs1o992.mjs";
3
- import { r as createMiddleware } from "./middleware-CE6OhDkq.mjs";
4
- import { f as createEndpoint, r as getSessionFromCtx } from "./session-CM3rmOYF.mjs";
5
- import { n as originCheck } from "./origin-check-8Gajklvh.mjs";
1
+ import { n as crypto_exports } from "./crypto-BH-hD0lJ.mjs";
2
+ import { y as setSessionCookie } from "./cookies-D9aY_gJh.mjs";
3
+ import { r as createMiddleware } from "./middleware-Cakg4e1D.mjs";
4
+ import { f as createEndpoint, r as getSessionFromCtx } from "./session-BGjJgihS.mjs";
5
+ import { n as originCheck } from "./origin-check-CRgs1M7k.mjs";
6
6
  import { callbackURLSchema, createRoute, emailSchema, req, res } from "@faire-auth/core/factory";
7
7
  import { Definitions, False, Routes, SCHEMAS, True } from "@faire-auth/core/static";
8
8
  import { capitalizeFirstLetter } from "@faire-auth/core/utils";
9
- import * as z$1 from "zod";
9
+ import * as z from "zod";
10
10
  import { jwtVerify } from "jose";
11
11
  import { JWTExpired } from "jose/errors";
12
-
13
- //#region src/api/schema/email-verification.ts
14
- const sendVerificationEmailSchema = z$1.object({
12
+ // src/api/schema/email-verification.ts
13
+ const sendVerificationEmailSchema = z.object({
15
14
  email: emailSchema.openapi({ description: "The email to send the verification email to" }),
16
15
  callbackURL: callbackURLSchema(true).openapi({ description: "The URL to use for email verification callback" })
17
16
  });
18
- const verifyEmailQuerySchema = z$1.object({
19
- token: z$1.string().openapi({ description: "The token to verify the email" }),
17
+ const verifyEmailQuerySchema = z.object({
18
+ token: z.string().openapi({ description: "The token to verify the email" }),
20
19
  callbackURL: callbackURLSchema(true).openapi({ description: "The URL to redirect to after email verification" })
21
20
  });
22
- const verifyEmailTokenSchema = z$1.object({
21
+ const verifyEmailTokenSchema = z.object({
23
22
  email: emailSchema,
24
- updateTo: z$1.string().optional()
23
+ updateTo: z.string().optional()
25
24
  });
26
-
27
- //#endregion
28
- //#region src/api/middleware/token-check.ts
25
+ // src/api/middleware/token-check.ts
29
26
  const onError = async (ctx, error) => {
30
27
  let code;
31
28
  if (error === "missing_token") code = 400;
@@ -60,16 +57,15 @@ const verifyToken = async (token, context) => {
60
57
  const tokenCheck = (getValue, schema) => createMiddleware()(async (ctx, next) => {
61
58
  const token = await getValue(ctx);
62
59
  if (!token) return onError(ctx, "missing_token");
63
- const res$1 = await verifyToken(token, ctx.get("context"));
64
- if (typeof res$1 === "string") return onError(ctx, res$1);
65
- const dat = await schema.safeParseAsync(res$1.payload);
60
+ const context = ctx.get("context");
61
+ const res = await verifyToken(token, context);
62
+ if (typeof res === "string") return onError(ctx, res);
63
+ const dat = await schema.safeParseAsync(res.payload);
66
64
  if (dat.success === false) return onError(ctx, "invalid_token");
67
65
  ctx.set("token", dat.data);
68
66
  return await next();
69
67
  });
70
-
71
- //#endregion
72
- //#region src/api/routes/email-verification.ts
68
+ // src/api/routes/email-verification.ts
73
69
  const createEmailVerificationToken = async (secret, email, updateTo, expiresIn = 3600) => {
74
70
  return await (0, crypto_exports.signJWT)({
75
71
  email: email.toLowerCase(),
@@ -161,17 +157,17 @@ const verifyEmail = createEndpoint(verifyEmailRoute, (options) => async (ctx) =>
161
157
  if (parsed.updateTo) {
162
158
  const session = await getSessionFromCtx(ctx);
163
159
  if (session instanceof Response || session.user.email !== parsed.email) return redirectOnError("unauthorized");
164
- const updatedUser$1 = await context.internalAdapter.updateUserByEmail(parsed.email, {
160
+ const updatedUser = await context.internalAdapter.updateUserByEmail(parsed.email, {
165
161
  email: parsed.updateTo,
166
162
  emailVerified: false
167
163
  });
168
- if (updatedUser$1 == null) return ctx.render({
164
+ if (updatedUser == null) return ctx.render({
169
165
  success: False,
170
166
  message: "Failed to update user"
171
167
  }, 500);
172
168
  const newToken = await createEmailVerificationToken(context.secret, parsed.updateTo);
173
169
  if (options.emailVerification?.sendVerificationEmail) await options.emailVerification.sendVerificationEmail({
174
- user: updatedUser$1,
170
+ user: updatedUser,
175
171
  url: `${context.baseURL}/verify-email?token=${newToken}&callbackURL=${callbackURL ?? encodeURIComponent("/")}`,
176
172
  token: newToken
177
173
  }, ctx);
@@ -187,7 +183,7 @@ const verifyEmail = createEndpoint(verifyEmailRoute, (options) => async (ctx) =>
187
183
  return ctx.render({
188
184
  success: True,
189
185
  token: session.session.token,
190
- user: updatedUser$1
186
+ user: updatedUser
191
187
  }, 200);
192
188
  }
193
189
  if (options.emailVerification?.onEmailVerification) await options.emailVerification.onEmailVerification(user.user, ctx.req);
@@ -223,6 +219,4 @@ const verifyEmail = createEndpoint(verifyEmailRoute, (options) => async (ctx) =>
223
219
  if (callbackURL != null) return ctx.redirect(callbackURL, 302);
224
220
  return ctx.render({ success: False }, 200);
225
221
  });
226
-
227
- //#endregion
228
- export { sendVerificationEmail as n, verifyEmail as r, createEmailVerificationToken as t };
222
+ export { sendVerificationEmail as n, verifyEmail as r, createEmailVerificationToken as t };