@rpcbase/auth 0.197.0 → 0.199.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.
- package/dist/components/AppleSignInButton/index.d.ts +1 -1
- package/dist/components/AppleSignInButton/index.d.ts.map +1 -1
- package/dist/components/AuthLayout/index.d.ts +1 -1
- package/dist/components/AuthLayout/index.d.ts.map +1 -1
- package/dist/components/EmailInput/index.d.ts +1 -1
- package/dist/components/EmailInput/index.d.ts.map +1 -1
- package/dist/components/PasswordInput/index.d.ts +1 -1
- package/dist/components/PasswordInput/index.d.ts.map +1 -1
- package/dist/components/RememberMeCheckbox/index.d.ts +1 -1
- package/dist/components/RememberMeCheckbox/index.d.ts.map +1 -1
- package/dist/components/ResendCodeButton/index.d.ts +1 -1
- package/dist/components/ResendCodeButton/index.d.ts.map +1 -1
- package/dist/components/SignInForm/index.d.ts +1 -1
- package/dist/components/SignInForm/index.d.ts.map +1 -1
- package/dist/components/SignUpForm/index.d.ts +1 -1
- package/dist/components/SignUpForm/index.d.ts.map +1 -1
- package/dist/{handler-DAKI9QOQ.js → handler-1Jy7G8dM.js} +2 -2
- package/dist/handler-1Jy7G8dM.js.map +1 -0
- package/dist/{handler-Dw3o3smk.js → handler-B1Z9YpER.js} +3 -3
- package/dist/handler-B1Z9YpER.js.map +1 -0
- package/dist/{handler-W_XZ0lnx.js → handler-BgjYCWF4.js} +2 -2
- package/dist/handler-BgjYCWF4.js.map +1 -0
- package/dist/{handler-DetFi4-9.js → handler-BkZLC8Bg.js} +3 -3
- package/dist/handler-BkZLC8Bg.js.map +1 -0
- package/dist/{handler-J2FOxq-2.js → handler-CF3fSh8e.js} +2 -2
- package/dist/handler-CF3fSh8e.js.map +1 -0
- package/dist/{handler-DH9FPTNh.js → handler-D4ui5jV4.js} +2 -2
- package/dist/handler-D4ui5jV4.js.map +1 -0
- package/dist/{handler-DQvdRpG2.js → handler-DBbjgU-f.js} +2 -2
- package/dist/handler-DBbjgU-f.js.map +1 -0
- package/dist/{handler-BY6DP3QP.js → handler-Dbw6BOmj.js} +3 -3
- package/dist/handler-Dbw6BOmj.js.map +1 -0
- package/dist/{handler-DoyR_l2O.js → handler-DgIcxthg.js} +2 -2
- package/dist/handler-DgIcxthg.js.map +1 -0
- package/dist/{handler-DAfIloZR.js → handler-iT2eSHpE.js} +3 -3
- package/dist/handler-iT2eSHpE.js.map +1 -0
- package/dist/index.js +64 -195
- package/dist/index.js.map +1 -1
- package/dist/middleware-BT3Uput1.js.map +1 -1
- package/dist/oauth/index.js +2 -2
- package/dist/oauth/index.js.map +1 -1
- package/dist/routes.js +10 -10
- package/dist/routes.js.map +1 -1
- package/dist/{schemas-BgOpQqUv.js → schemas-CMgO_xn9.js} +29 -22
- package/dist/{schemas-BgOpQqUv.js.map → schemas-CMgO_xn9.js.map} +1 -1
- package/dist/session-BQ06Yo3C.js.map +1 -1
- package/dist/{sign-in-BkhQovKN.js → sign-in-DYq3bJeH.js} +2 -2
- package/dist/sign-in-DYq3bJeH.js.map +1 -0
- package/dist/{sign-up-Di48rzbG.js → sign-up-CYGadNUe.js} +2 -2
- package/dist/sign-up-CYGadNUe.js.map +1 -0
- package/package.json +1 -1
- package/dist/handler-BY6DP3QP.js.map +0 -1
- package/dist/handler-DAKI9QOQ.js.map +0 -1
- package/dist/handler-DAfIloZR.js.map +0 -1
- package/dist/handler-DH9FPTNh.js.map +0 -1
- package/dist/handler-DQvdRpG2.js.map +0 -1
- package/dist/handler-DetFi4-9.js.map +0 -1
- package/dist/handler-DoyR_l2O.js.map +0 -1
- package/dist/handler-Dw3o3smk.js.map +0 -1
- package/dist/handler-J2FOxq-2.js.map +0 -1
- package/dist/handler-W_XZ0lnx.js.map +0 -1
- package/dist/sign-in-BkhQovKN.js.map +0 -1
- package/dist/sign-up-Di48rzbG.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as requestSchema } from "./sign-in-
|
|
2
|
-
import { n as requestSchema$1 } from "./sign-up-
|
|
1
|
+
import { n as requestSchema } from "./sign-in-DYq3bJeH.js";
|
|
2
|
+
import { n as requestSchema$1 } from "./sign-up-CYGadNUe.js";
|
|
3
3
|
import { n as requireSession, r as restrictSessionMiddleware, t as redirectAuthMiddleware } from "./middleware-BT3Uput1.js";
|
|
4
|
-
import { c } from "react/compiler-runtime";
|
|
5
4
|
import { createContext, createElement, forwardRef, useContext, useEffect, useRef, useState } from "react";
|
|
6
5
|
import { Link, useLocation, useNavigate, useSearchParams } from "@rpcbase/router";
|
|
7
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
8
8
|
import clsx from "clsx";
|
|
9
9
|
import { FormProvider, useForm, useFormContext, zodResolver } from "@rpcbase/form";
|
|
10
10
|
import { Input, cn } from "@rpcbase/ui";
|
|
@@ -23,58 +23,28 @@ var LINKS_REDIRECTION_MAP = {
|
|
|
23
23
|
"location": "/auth/sign-in"
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
var AuthLayout = (
|
|
27
|
-
const $ = c(11);
|
|
28
|
-
const { sidePanel: t1, children } = t0;
|
|
29
|
-
const sidePanel = t1 === void 0 ? null : t1;
|
|
26
|
+
var AuthLayout = ({ sidePanel = null, children }) => {
|
|
30
27
|
const location = useLocation();
|
|
31
28
|
const linkTitle = LINKS_REDIRECTION_MAP[location.pathname]?.title;
|
|
32
29
|
const linkLocation = LINKS_REDIRECTION_MAP[location.pathname]?.location;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
$[4] = t3;
|
|
52
|
-
} else t3 = $[4];
|
|
53
|
-
let t4;
|
|
54
|
-
if ($[5] !== children) {
|
|
55
|
-
t4 = /* @__PURE__ */ jsx("div", {
|
|
56
|
-
className: "mx-auto flex w-full flex-col justify-center gap-6 /*sm:w-[350px]*/",
|
|
57
|
-
children
|
|
58
|
-
});
|
|
59
|
-
$[5] = children;
|
|
60
|
-
$[6] = t4;
|
|
61
|
-
} else t4 = $[6];
|
|
62
|
-
let t5;
|
|
63
|
-
if ($[7] !== t2 || $[8] !== t3 || $[9] !== t4) {
|
|
64
|
-
t5 = /* @__PURE__ */ jsxs("div", {
|
|
65
|
-
className: "container relative flex min-h-dvh flex-col items-center justify-center px-4 py-20 sm:px-6 md:px-8 lg:grid lg:h-dvh lg:w-full lg:max-w-none lg:grid-cols-2 lg:px-0 lg:py-0",
|
|
66
|
-
children: [
|
|
67
|
-
t2,
|
|
68
|
-
t3,
|
|
69
|
-
t4
|
|
70
|
-
]
|
|
71
|
-
});
|
|
72
|
-
$[7] = t2;
|
|
73
|
-
$[8] = t3;
|
|
74
|
-
$[9] = t4;
|
|
75
|
-
$[10] = t5;
|
|
76
|
-
} else t5 = $[10];
|
|
77
|
-
return t5;
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
31
|
+
className: "container relative flex min-h-dvh flex-col items-center justify-center px-4 py-20 sm:px-6 md:px-8 lg:grid lg:h-dvh lg:w-full lg:max-w-none lg:grid-cols-2 lg:px-0 lg:py-0",
|
|
32
|
+
children: [
|
|
33
|
+
linkTitle && linkLocation ? /* @__PURE__ */ jsx(Link, {
|
|
34
|
+
className: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 absolute right-4 top-4 md:right-8 md:top-8",
|
|
35
|
+
to: linkLocation,
|
|
36
|
+
children: linkTitle
|
|
37
|
+
}) : null,
|
|
38
|
+
/* @__PURE__ */ jsx("div", {
|
|
39
|
+
className: "relative hidden h-full flex-col bg-muted p-10 text-white dark:border-r lg:flex",
|
|
40
|
+
children: sidePanel
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx("div", {
|
|
43
|
+
className: "mx-auto flex w-full flex-col justify-center gap-6 /*sm:w-[350px]*/",
|
|
44
|
+
children
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
});
|
|
78
48
|
};
|
|
79
49
|
//#endregion
|
|
80
50
|
//#region src/components/AppleSignInButton/index.tsx
|
|
@@ -324,50 +294,21 @@ var SignUpForm = ({ children, className, otpNextPath }) => {
|
|
|
324
294
|
};
|
|
325
295
|
//#endregion
|
|
326
296
|
//#region src/components/RememberMeCheckbox/index.tsx
|
|
327
|
-
var RememberMeCheckbox = (
|
|
328
|
-
const $ = c(10);
|
|
329
|
-
const { label, as: t1 } = t0;
|
|
330
|
-
const Component = t1 === void 0 ? "input" : t1;
|
|
297
|
+
var RememberMeCheckbox = ({ label, as: Component = "input" }) => {
|
|
331
298
|
const { register } = useFormContext();
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
t3 = /* @__PURE__ */ jsx(Component, {
|
|
341
|
-
id: "rememberMe",
|
|
342
|
-
...t2
|
|
343
|
-
});
|
|
344
|
-
$[2] = Component;
|
|
345
|
-
$[3] = t2;
|
|
346
|
-
$[4] = t3;
|
|
347
|
-
} else t3 = $[4];
|
|
348
|
-
let t4;
|
|
349
|
-
if ($[5] !== label) {
|
|
350
|
-
t4 = /* @__PURE__ */ jsx("label", {
|
|
351
|
-
htmlFor: "rememberMe",
|
|
352
|
-
className: "pl-2 block text-sm/6 text-gray-900",
|
|
353
|
-
children: label
|
|
354
|
-
});
|
|
355
|
-
$[5] = label;
|
|
356
|
-
$[6] = t4;
|
|
357
|
-
} else t4 = $[6];
|
|
358
|
-
let t5;
|
|
359
|
-
if ($[7] !== t3 || $[8] !== t4) {
|
|
360
|
-
t5 = /* @__PURE__ */ jsxs(Fragment, { children: [t3, t4] });
|
|
361
|
-
$[7] = t3;
|
|
362
|
-
$[8] = t4;
|
|
363
|
-
$[9] = t5;
|
|
364
|
-
} else t5 = $[9];
|
|
365
|
-
return t5;
|
|
299
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Component, {
|
|
300
|
+
id: "rememberMe",
|
|
301
|
+
...register("rememberMe")
|
|
302
|
+
}), /* @__PURE__ */ jsx("label", {
|
|
303
|
+
htmlFor: "rememberMe",
|
|
304
|
+
className: "pl-2 block text-sm/6 text-gray-900",
|
|
305
|
+
children: label
|
|
306
|
+
})] });
|
|
366
307
|
};
|
|
367
308
|
//#endregion
|
|
368
309
|
//#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
|
|
369
310
|
/**
|
|
370
|
-
* @license lucide-react v1.
|
|
311
|
+
* @license lucide-react v1.34.0 - ISC
|
|
371
312
|
*
|
|
372
313
|
* This source code is licensed under the ISC license.
|
|
373
314
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -378,7 +319,7 @@ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
|
378
319
|
//#endregion
|
|
379
320
|
//#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs
|
|
380
321
|
/**
|
|
381
|
-
* @license lucide-react v1.
|
|
322
|
+
* @license lucide-react v1.34.0 - ISC
|
|
382
323
|
*
|
|
383
324
|
* This source code is licensed under the ISC license.
|
|
384
325
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -387,7 +328,7 @@ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLo
|
|
|
387
328
|
//#endregion
|
|
388
329
|
//#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs
|
|
389
330
|
/**
|
|
390
|
-
* @license lucide-react v1.
|
|
331
|
+
* @license lucide-react v1.34.0 - ISC
|
|
391
332
|
*
|
|
392
333
|
* This source code is licensed under the ISC license.
|
|
393
334
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -396,7 +337,7 @@ var toCamelCase = (string) => string.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1
|
|
|
396
337
|
//#endregion
|
|
397
338
|
//#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.mjs
|
|
398
339
|
/**
|
|
399
|
-
* @license lucide-react v1.
|
|
340
|
+
* @license lucide-react v1.34.0 - ISC
|
|
400
341
|
*
|
|
401
342
|
* This source code is licensed under the ISC license.
|
|
402
343
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -408,7 +349,7 @@ var toPascalCase = (string) => {
|
|
|
408
349
|
//#endregion
|
|
409
350
|
//#region ../../node_modules/lucide-react/dist/esm/defaultAttributes.mjs
|
|
410
351
|
/**
|
|
411
|
-
* @license lucide-react v1.
|
|
352
|
+
* @license lucide-react v1.34.0 - ISC
|
|
412
353
|
*
|
|
413
354
|
* This source code is licensed under the ISC license.
|
|
414
355
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -427,7 +368,7 @@ var defaultAttributes = {
|
|
|
427
368
|
//#endregion
|
|
428
369
|
//#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs
|
|
429
370
|
/**
|
|
430
|
-
* @license lucide-react v1.
|
|
371
|
+
* @license lucide-react v1.34.0 - ISC
|
|
431
372
|
*
|
|
432
373
|
* This source code is licensed under the ISC license.
|
|
433
374
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -439,7 +380,7 @@ var hasA11yProp = (props) => {
|
|
|
439
380
|
//#endregion
|
|
440
381
|
//#region ../../node_modules/lucide-react/dist/esm/context.mjs
|
|
441
382
|
/**
|
|
442
|
-
* @license lucide-react v1.
|
|
383
|
+
* @license lucide-react v1.34.0 - ISC
|
|
443
384
|
*
|
|
444
385
|
* This source code is licensed under the ISC license.
|
|
445
386
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -449,7 +390,7 @@ var useLucideContext = () => useContext(LucideContext);
|
|
|
449
390
|
//#endregion
|
|
450
391
|
//#region ../../node_modules/lucide-react/dist/esm/Icon.mjs
|
|
451
392
|
/**
|
|
452
|
-
* @license lucide-react v1.
|
|
393
|
+
* @license lucide-react v1.34.0 - ISC
|
|
453
394
|
*
|
|
454
395
|
* This source code is licensed under the ISC license.
|
|
455
396
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -472,7 +413,7 @@ var Icon = forwardRef(({ color, size, strokeWidth, absoluteStrokeWidth, classNam
|
|
|
472
413
|
//#endregion
|
|
473
414
|
//#region ../../node_modules/lucide-react/dist/esm/createLucideIcon.mjs
|
|
474
415
|
/**
|
|
475
|
-
* @license lucide-react v1.
|
|
416
|
+
* @license lucide-react v1.34.0 - ISC
|
|
476
417
|
*
|
|
477
418
|
* This source code is licensed under the ISC license.
|
|
478
419
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -488,7 +429,7 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
|
488
429
|
return Component;
|
|
489
430
|
};
|
|
490
431
|
/**
|
|
491
|
-
* @license lucide-react v1.
|
|
432
|
+
* @license lucide-react v1.34.0 - ISC
|
|
492
433
|
*
|
|
493
434
|
* This source code is licensed under the ISC license.
|
|
494
435
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -512,7 +453,7 @@ var EyeOff = createLucideIcon("eye-off", [
|
|
|
512
453
|
}]
|
|
513
454
|
]);
|
|
514
455
|
/**
|
|
515
|
-
* @license lucide-react v1.
|
|
456
|
+
* @license lucide-react v1.34.0 - ISC
|
|
516
457
|
*
|
|
517
458
|
* This source code is licensed under the ISC license.
|
|
518
459
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -528,111 +469,39 @@ var Eye = createLucideIcon("eye", [["path", {
|
|
|
528
469
|
}]]);
|
|
529
470
|
//#endregion
|
|
530
471
|
//#region src/components/PasswordInput/index.tsx
|
|
531
|
-
var PasswordInput = (
|
|
532
|
-
const $ = c(26);
|
|
533
|
-
const { id, name: t1, className, placeholder, autoComplete: t2 } = t0;
|
|
534
|
-
const name = t1 === void 0 ? "password" : t1;
|
|
535
|
-
const autoComplete = t2 === void 0 ? "current-password" : t2;
|
|
472
|
+
var PasswordInput = ({ id, name = "password", className, placeholder, autoComplete = "current-password" }) => {
|
|
536
473
|
const [showPassword, setShowPassword] = useState(false);
|
|
537
474
|
const { register, formState } = useFormContext();
|
|
538
475
|
const fieldError = formState.errors[name];
|
|
539
476
|
const errorMessage = typeof fieldError === "string" ? fieldError : typeof fieldError?.message === "string" ? fieldError.message : void 0;
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
$[1] = t3;
|
|
545
|
-
} else t3 = $[1];
|
|
546
|
-
const inputClassName = t3;
|
|
547
|
-
const t4 = showPassword ? "text" : "password";
|
|
548
|
-
const t5 = name;
|
|
549
|
-
let t6;
|
|
550
|
-
if ($[2] !== register || $[3] !== t5) {
|
|
551
|
-
t6 = register(t5);
|
|
552
|
-
$[2] = register;
|
|
553
|
-
$[3] = t5;
|
|
554
|
-
$[4] = t6;
|
|
555
|
-
} else t6 = $[4];
|
|
556
|
-
let t7;
|
|
557
|
-
if ($[5] !== autoComplete || $[6] !== id || $[7] !== inputClassName || $[8] !== placeholder || $[9] !== t4 || $[10] !== t6) {
|
|
558
|
-
t7 = /* @__PURE__ */ jsx(Input, {
|
|
477
|
+
const inputClassName = cn(className, "pr-11");
|
|
478
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
479
|
+
className: "relative",
|
|
480
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
559
481
|
id,
|
|
560
|
-
type:
|
|
482
|
+
type: showPassword ? "text" : "password",
|
|
561
483
|
autoComplete,
|
|
562
484
|
className: inputClassName,
|
|
563
485
|
placeholder,
|
|
564
|
-
...
|
|
565
|
-
})
|
|
566
|
-
$[5] = autoComplete;
|
|
567
|
-
$[6] = id;
|
|
568
|
-
$[7] = inputClassName;
|
|
569
|
-
$[8] = placeholder;
|
|
570
|
-
$[9] = t4;
|
|
571
|
-
$[10] = t6;
|
|
572
|
-
$[11] = t7;
|
|
573
|
-
} else t7 = $[11];
|
|
574
|
-
let t8;
|
|
575
|
-
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
576
|
-
t8 = () => setShowPassword(_temp);
|
|
577
|
-
$[12] = t8;
|
|
578
|
-
} else t8 = $[12];
|
|
579
|
-
const t9 = showPassword ? "Hide characters" : "Show characters";
|
|
580
|
-
let t10;
|
|
581
|
-
if ($[13] !== showPassword) {
|
|
582
|
-
t10 = showPassword ? /* @__PURE__ */ jsx(EyeOff, {
|
|
583
|
-
className: "h-5 w-5",
|
|
584
|
-
"aria-hidden": true
|
|
585
|
-
}) : /* @__PURE__ */ jsx(Eye, {
|
|
586
|
-
className: "h-5 w-5",
|
|
587
|
-
"aria-hidden": true
|
|
588
|
-
});
|
|
589
|
-
$[13] = showPassword;
|
|
590
|
-
$[14] = t10;
|
|
591
|
-
} else t10 = $[14];
|
|
592
|
-
let t11;
|
|
593
|
-
if ($[15] !== t10 || $[16] !== t9) {
|
|
594
|
-
t11 = /* @__PURE__ */ jsx("button", {
|
|
486
|
+
...register(name)
|
|
487
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
595
488
|
type: "button",
|
|
596
489
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500",
|
|
597
|
-
onClick:
|
|
598
|
-
"aria-label":
|
|
599
|
-
children:
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
$[18] = t11;
|
|
612
|
-
$[19] = t7;
|
|
613
|
-
$[20] = t12;
|
|
614
|
-
} else t12 = $[20];
|
|
615
|
-
let t13;
|
|
616
|
-
if ($[21] !== errorMessage) {
|
|
617
|
-
t13 = errorMessage ? /* @__PURE__ */ jsx("p", {
|
|
618
|
-
className: "mt-1 -mb-2 text-sm/6 text-red-500",
|
|
619
|
-
children: errorMessage
|
|
620
|
-
}) : null;
|
|
621
|
-
$[21] = errorMessage;
|
|
622
|
-
$[22] = t13;
|
|
623
|
-
} else t13 = $[22];
|
|
624
|
-
let t14;
|
|
625
|
-
if ($[23] !== t12 || $[24] !== t13) {
|
|
626
|
-
t14 = /* @__PURE__ */ jsxs(Fragment, { children: [t12, t13] });
|
|
627
|
-
$[23] = t12;
|
|
628
|
-
$[24] = t13;
|
|
629
|
-
$[25] = t14;
|
|
630
|
-
} else t14 = $[25];
|
|
631
|
-
return t14;
|
|
490
|
+
onClick: () => setShowPassword((prev) => !prev),
|
|
491
|
+
"aria-label": showPassword ? "Hide characters" : "Show characters",
|
|
492
|
+
children: showPassword ? /* @__PURE__ */ jsx(EyeOff, {
|
|
493
|
+
className: "h-5 w-5",
|
|
494
|
+
"aria-hidden": true
|
|
495
|
+
}) : /* @__PURE__ */ jsx(Eye, {
|
|
496
|
+
className: "h-5 w-5",
|
|
497
|
+
"aria-hidden": true
|
|
498
|
+
})
|
|
499
|
+
})]
|
|
500
|
+
}), errorMessage ? /* @__PURE__ */ jsx("p", {
|
|
501
|
+
className: "mt-1 -mb-2 text-sm/6 text-red-500",
|
|
502
|
+
children: errorMessage
|
|
503
|
+
}) : null] });
|
|
632
504
|
};
|
|
633
|
-
function _temp(prev) {
|
|
634
|
-
return !prev;
|
|
635
|
-
}
|
|
636
505
|
//#endregion
|
|
637
506
|
//#region src/components/ResendCodeButton/index.tsx
|
|
638
507
|
var useResendCountdown = (t0, t1) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","Link","useLocation","LINKS_REDIRECTION_MAP","Pathname","AuthLayout","t0","$","_c","sidePanel","t1","children","undefined","location","linkTitle","pathname","title","linkLocation","t2","t3","t4","t5","clsx","AppleSignInButton","t0","$","_c","onPress","className","t1","t2","t3","Symbol","for","t4","useFormContext","Input","EmailInput","t0","$","_c","id","className","placeholder","register","formState","error","errors","email","errorMessage","message","t1","t2","t3","t4","hasUnsafeNextPathChars","value","i","length","code","charCodeAt","sanitizeNextPath","raw","nextPath","trim","startsWith","base","URL","url","origin","pathname","search","hash","ReactNode","useNavigate","useSearchParams","useForm","FormProvider","zodResolver","SubmitHandler","z","requestSchema","sanitizeNextPath","SignInFormValues","input","SignInForm","children","className","navigate","searchParams","methods","defaultValues","email","password","rememberMe","navigationGuard","resolver","onSubmit","data","clearErrors","res","fetch","method","headers","body","JSON","stringify","credentials","json","catch","success","error","ok","message","setError","type","nextPath","get","replace","err","handleSubmit","formState","errors","root","ReactNode","useState","useNavigate","useForm","FormProvider","zodResolver","SubmitHandler","z","requestSchema","SignUpFormValues","input","SignUpForm","children","className","otpNextPath","navigate","serverMessage","setServerMessage","methods","defaultValues","email","password","rememberMe","navigationGuard","resolver","onSubmit","data","clearErrors","res","fetch","method","headers","body","JSON","stringify","credentials","json","ok","message","error","setError","type","success","search","URLSearchParams","set","toString","err","handleSubmit","formState","errors","root","ElementType","useFormContext","RememberMeCheckbox","t0","$","_c","label","as","t1","Component","undefined","register","t2","t3","t4","t5","__iconNode","useState","Eye","EyeOff","useFormContext","cn","Input","PasswordInputProps","id","name","className","placeholder","autoComplete","PasswordInput","t0","$","_c","t1","t2","undefined","showPassword","setShowPassword","register","formState","fieldError","errors","errorMessage","message","t3","inputClassName","t4","t5","Parameters","t6","t7","t8","Symbol","for","_temp","t9","t10","t11","t12","t13","t14","prev","useEffect","useState","clsx","useResendCountdown","t0","t1","$","_c","seconds","undefined","initiallyCountingDown","remaining","setRemaining","isCountingDown","setIsCountingDown","t2","t3","timer","setInterval","prev","clearInterval","t4","nextSeconds","value","restart","minutes","Math","floor","secs","t5","toString","padStart","formatted","canResend","t6","ResendCodeButton","onResend","className","disabled","Promise","isSending","setIsSending","handleClick","isDisabled","showCountdown","useRef","useState","useResendCountdown","DEFAULT_PASSWORD_RESET_COOLDOWN_SECONDS","PasswordResetCodeRequestResult","retryAfterSeconds","PasswordResetCodeRequestError","Error","errorCode","constructor","name","parseRetryAfterSeconds","value","seconds","Number","isFinite","undefined","Math","ceil","requestPasswordResetCode","email","Promise","response","fetch","method","headers","body","JSON","stringify","payload","json","catch","success","error","get","ok","usePasswordResetResend","cooldownSeconds","countdown","isResending","setIsResending","isResendingRef","resend","canResend","current","result","restart","remainingSeconds","remaining","formatted","isCountingDown","Boolean"],"sources":["../src/components/AuthLayout/index.tsx","../src/components/AppleSignInButton/index.tsx","../src/components/EmailInput/index.tsx","../src/utils/sanitizeNextPath.ts","../src/components/SignInForm/index.tsx","../src/components/SignUpForm/index.tsx","../src/components/RememberMeCheckbox/index.tsx","../../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs","../../../node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs","../../../node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs","../../../node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.mjs","../../../node_modules/lucide-react/dist/esm/defaultAttributes.mjs","../../../node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs","../../../node_modules/lucide-react/dist/esm/context.mjs","../../../node_modules/lucide-react/dist/esm/Icon.mjs","../../../node_modules/lucide-react/dist/esm/createLucideIcon.mjs","../../../node_modules/lucide-react/dist/esm/icons/eye-off.mjs","../../../node_modules/lucide-react/dist/esm/icons/eye.mjs","../src/components/PasswordInput/index.tsx","../src/components/ResendCodeButton/index.tsx","../src/passwordReset.ts"],"sourcesContent":["import * as React from \"react\"\nimport {Link, useLocation } from \"@rpcbase/router\"\n\n\nconst LINKS_REDIRECTION_MAP = {\n \"/auth/sign-in\": {\n \"title\": \"Sign Up\",\n \"location\": \"/auth/sign-up\"\n },\n \"/auth/sign-up\": {\n \"title\": \"Sign In\",\n \"location\": \"/auth/sign-in\"\n },\n \"/auth/logout-success\": {\n \"title\": \"Sign In\",\n \"location\": \"/auth/sign-in\"\n }\n}\n\ntype Pathname = keyof typeof LINKS_REDIRECTION_MAP\n\nexport const AuthLayout = ({\n sidePanel = null,\n children,\n}: {\n sidePanel: React.ReactElement | null\n children: React.ReactNode\n}) => {\n const location = useLocation()\n\n const linkTitle = LINKS_REDIRECTION_MAP[location.pathname as Pathname]?.title\n const linkLocation = LINKS_REDIRECTION_MAP[location.pathname as Pathname]?.location\n\n return (\n <div className=\"container relative flex min-h-dvh flex-col items-center justify-center px-4 py-20 sm:px-6 md:px-8 lg:grid lg:h-dvh lg:w-full lg:max-w-none lg:grid-cols-2 lg:px-0 lg:py-0\">\n {/* Top-right redirection link */}\n {linkTitle && linkLocation ? (\n <Link\n className=\"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 absolute right-4 top-4 md:right-8 md:top-8\"\n to={linkLocation}\n >\n {linkTitle}\n </Link>\n ) : null}\n <div className=\"relative hidden h-full flex-col bg-muted p-10 text-white dark:border-r lg:flex\">\n {sidePanel}\n </div>\n <div className=\"mx-auto flex w-full flex-col justify-center gap-6 /*sm:w-[350px]*/\">\n {children}\n </div>\n </div>\n )\n}\n","import clsx from \"clsx\"\n\n\nexport const AppleSignInButton = ({\n onPress,\n className,\n}: {\n onPress: () => void;\n className?: string;\n}) => {\n\n return (\n <button\n onClick={onPress}\n className={clsx(`\n w-full\n bg-black text-white hover:bg-gray-800\n flex items-center justify-center\n px-6 py-2\n rounded-lg\n font-medium\n transition duration-150 ease-in-out\n focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black\n `, className)}\n >\n <svg\n className=\"w-5 h-5 mr-3\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"white\"\n >\n <path d=\"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.539 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701\" />\n </svg>\n <span>Continue with Apple</span>\n </button>\n )\n}\n","import {useFormContext} from \"@rpcbase/form\"\nimport { Input } from \"@rpcbase/ui\"\n\n\nexport const EmailInput = ({\n id,\n className,\n placeholder,\n}: {\n id: string\n className?: string\n placeholder?: string\n}) => {\n const {register, formState} = useFormContext()\n\n const error = formState.errors.email\n let errorMessage: string | undefined\n if (typeof error === \"string\") {\n errorMessage = error\n } else if (error && typeof error.message === \"string\") {\n errorMessage = error.message\n }\n\n return (\n <>\n <Input\n id={id}\n type=\"email\"\n required\n autoComplete=\"email\"\n className={className}\n placeholder={placeholder}\n {...register(\"email\")}\n />\n {errorMessage ? (\n <p className=\"mt-1 -mb-2 text-sm/6 text-red-500\">{errorMessage}</p>\n ) : null}\n </>\n )\n}\n","const hasUnsafeNextPathChars = (value: string) => {\n for (let i = 0; i < value.length; i++) {\n const code = value.charCodeAt(i)\n if (code === 92 || code <= 31 || code === 127) return true\n }\n return false\n}\n\nexport const sanitizeNextPath = (raw: string | null) => {\n if (!raw) return null\n\n const nextPath = raw.trim()\n if (!nextPath) return null\n\n if (!nextPath.startsWith(\"/\") || nextPath.startsWith(\"//\")) {\n return null\n }\n\n if (hasUnsafeNextPathChars(nextPath)) {\n return null\n }\n\n try {\n const base = new URL(\"http://localhost\")\n const url = new URL(nextPath, base)\n if (url.origin !== base.origin) {\n return null\n }\n return `${url.pathname}${url.search}${url.hash}`\n } catch {\n return null\n }\n}\n\n","import { ReactNode } from \"react\"\nimport { useNavigate, useSearchParams } from \"@rpcbase/router\"\nimport { useForm, FormProvider, zodResolver } from \"@rpcbase/form\"\nimport type { SubmitHandler } from \"@rpcbase/form\"\nimport { z } from \"zod\"\n\nimport {requestSchema} from \"../../api/sign-in\"\nimport { sanitizeNextPath } from \"../../utils/sanitizeNextPath\"\n\n\ntype SignInFormValues = z.input<typeof requestSchema>\n\nexport const SignInForm = ({\n children,\n className\n}: {\n children: ReactNode,\n className?: string\n}) => {\n const navigate = useNavigate()\n const [searchParams] = useSearchParams()\n\n const methods = useForm<SignInFormValues>({\n defaultValues: {\n email: \"\",\n password: \"\",\n rememberMe: true,\n },\n navigationGuard: false,\n resolver: zodResolver(requestSchema)\n })\n\n const onSubmit: SubmitHandler<SignInFormValues> = async (data) => {\n methods.clearErrors(\"root\")\n\n try {\n const res = await fetch(\"/api/rb/auth/sign-in\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n credentials: \"include\",\n })\n\n const json = await res.json().catch(() => null) as { success?: boolean; error?: string } | null\n\n if (!res.ok || !json?.success) {\n const message = json?.error === \"invalid_credentials\"\n ? \"Invalid email or password.\"\n : \"Sign-in failed. Please try again.\"\n methods.setError(\"root\", { type: \"server\", message })\n return\n }\n\n const nextPath = sanitizeNextPath(searchParams.get(\"next\")) ?? \"/\"\n navigate(nextPath, { replace: true })\n } catch (err) {\n methods.setError(\"root\", { type: \"server\", message: \"Network error. Please try again.\" })\n }\n }\n\n return (\n <FormProvider {...methods}>\n <form method=\"post\" noValidate className={className} onSubmit={methods.handleSubmit(onSubmit)}>\n {children}\n {methods.formState.errors.root?.message && (\n <p className=\"mt-2 text-sm text-red-600\" role=\"alert\">\n {methods.formState.errors.root.message}\n </p>\n )}\n </form>\n </FormProvider>\n )\n}\n","import {ReactNode, useState} from \"react\"\nimport { useNavigate } from \"@rpcbase/router\"\nimport { useForm, FormProvider, zodResolver } from \"@rpcbase/form\"\nimport type {SubmitHandler} from \"@rpcbase/form\"\nimport { z } from \"zod\"\n\nimport {requestSchema} from \"../../api/sign-up\"\n\n\ntype SignUpFormValues = z.input<typeof requestSchema>\n\n\nexport const SignUpForm = ({\n children,\n className,\n otpNextPath\n}: {\n children: ReactNode,\n className?: string\n otpNextPath?: string\n}) => {\n\n const navigate = useNavigate()\n\n const [serverMessage, setServerMessage] = useState<string | null>(null)\n const methods = useForm<SignUpFormValues>({\n defaultValues: {\n email: \"\",\n password: \"\",\n rememberMe: true,\n },\n navigationGuard: false,\n resolver: zodResolver(requestSchema)\n })\n\n const onSubmit: SubmitHandler<SignUpFormValues> = async (data) => {\n setServerMessage(null)\n methods.clearErrors(\"root\")\n\n try {\n const res = await fetch(\"/api/rb/auth/sign-up\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n credentials: \"include\",\n })\n\n const json = await res.json()\n\n if (!res.ok) {\n const message = json.error === \"user_exists\"\n ? \"An account already exists with this email.\"\n : \"Sign-up failed. Please try again.\"\n methods.setError(\"root\", { type: \"server\", message })\n return\n }\n\n if (!json.success) {\n methods.setError(\"root\", { type: \"server\", message: \"Sign-up failed. Please try again.\" })\n return\n }\n\n const search = new URLSearchParams({ email: data.email })\n if (otpNextPath) {\n search.set(\"next\", otpNextPath)\n }\n navigate(`/auth/sign-up-otp?${search.toString()}`)\n setServerMessage(\"Account created. Check your inbox to verify your email.\")\n } catch (err) {\n methods.setError(\"root\", { type: \"server\", message: \"Network error. Please try again.\" })\n }\n }\n\n return (\n <FormProvider {...methods}>\n <form method=\"post\" noValidate className={className} onSubmit={methods.handleSubmit(onSubmit)}>\n {children}\n {methods.formState.errors.root?.message && (\n <p className=\"mt-2 text-sm text-red-600\" role=\"alert\">\n {methods.formState.errors.root.message}\n </p>\n )}\n {serverMessage && (\n <p className=\"mt-2 text-sm text-green-700\" role=\"status\">\n {serverMessage}\n </p>\n )}\n </form>\n </FormProvider>\n )\n}\n","import type { ElementType } from \"react\"\nimport {useFormContext} from \"@rpcbase/form\"\n\n\nexport const RememberMeCheckbox = ({\n label,\n as: Component = \"input\"\n}: {\n label: string,\n as?: ElementType\n}) => {\n const {register} = useFormContext()\n\n return (\n <>\n <Component\n id=\"rememberMe\"\n {...register(\"rememberMe\")}\n />\n <label\n htmlFor={\"rememberMe\"}\n className=\"pl-2 block text-sm/6 text-gray-900\"\n >\n {label}\n </label>\n </>\n )\n}\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst mergeClasses = (...classes) => classes.filter((className, index, array) => {\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n}).join(\" \").trim();\n\nexport { mergeClasses };\n//# sourceMappingURL=mergeClasses.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\n\nexport { toKebabCase };\n//# sourceMappingURL=toKebabCase.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toCamelCase = (string) => string.replace(\n /^([A-Z])|[\\s-_]+(\\w)/g,\n (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()\n);\n\nexport { toCamelCase };\n//# sourceMappingURL=toCamelCase.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { toCamelCase } from './toCamelCase.mjs';\n\nconst toPascalCase = (string) => {\n const camelCase = toCamelCase(string);\n return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);\n};\n\nexport { toPascalCase };\n//# sourceMappingURL=toPascalCase.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nvar defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst hasA11yProp = (props) => {\n for (const prop in props) {\n if (prop.startsWith(\"aria-\") || prop === \"role\" || prop === \"title\") {\n return true;\n }\n }\n return false;\n};\n\nexport { hasA11yProp };\n//# sourceMappingURL=hasA11yProp.mjs.map\n","\"use strict\";\n\"use client\";\n/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { createContext, useContext, useMemo, createElement } from 'react';\n\nconst LucideContext = createContext({});\nfunction LucideProvider({\n children,\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n className\n}) {\n const value = useMemo(\n () => ({\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n className\n }),\n [size, color, strokeWidth, absoluteStrokeWidth, className]\n );\n return createElement(LucideContext.Provider, { value }, children);\n}\nconst useLucideContext = () => useContext(LucideContext);\n\nexport { LucideProvider, useLucideContext };\n//# sourceMappingURL=context.mjs.map\n","\"use strict\";\n\"use client\";\n/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.mjs';\nimport { hasA11yProp } from './shared/src/utils/hasA11yProp.mjs';\nimport { mergeClasses } from './shared/src/utils/mergeClasses.mjs';\nimport { useLucideContext } from './context.mjs';\n\nconst Icon = forwardRef(\n ({ color, size, strokeWidth, absoluteStrokeWidth, className = \"\", children, iconNode, ...rest }, ref) => {\n const {\n size: contextSize = 24,\n strokeWidth: contextStrokeWidth = 2,\n absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,\n color: contextColor = \"currentColor\",\n className: contextClass = \"\"\n } = useLucideContext() ?? {};\n const calculatedStrokeWidth = absoluteStrokeWidth ?? contextAbsoluteStrokeWidth ? Number(strokeWidth ?? contextStrokeWidth) * 24 / Number(size ?? contextSize) : strokeWidth ?? contextStrokeWidth;\n return createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size ?? contextSize ?? defaultAttributes.width,\n height: size ?? contextSize ?? defaultAttributes.height,\n stroke: color ?? contextColor,\n strokeWidth: calculatedStrokeWidth,\n className: mergeClasses(\"lucide\", contextClass, className),\n ...!children && !hasA11yProp(rest) && { \"aria-hidden\": \"true\" },\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n );\n }\n);\n\nexport { Icon as default };\n//# sourceMappingURL=Icon.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { mergeClasses } from './shared/src/utils/mergeClasses.mjs';\nimport { toKebabCase } from './shared/src/utils/toKebabCase.mjs';\nimport { toPascalCase } from './shared/src/utils/toPascalCase.mjs';\nimport Icon from './Icon.mjs';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({ className, ...props }, ref) => createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(\n `lucide-${toKebabCase(toPascalCase(iconName))}`,\n `lucide-${iconName}`,\n className\n ),\n ...props\n })\n );\n Component.displayName = toPascalCase(iconName);\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n key: \"ct8e1f\"\n }\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\", key: \"151rxh\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n key: \"13bj9a\"\n }\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n];\nconst EyeOff = createLucideIcon(\"eye-off\", __iconNode);\n\nexport { __iconNode, EyeOff as default };\n//# sourceMappingURL=eye-off.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Eye = createLucideIcon(\"eye\", __iconNode);\n\nexport { __iconNode, Eye as default };\n//# sourceMappingURL=eye.mjs.map\n","import { useState } from \"react\"\nimport { Eye, EyeOff } from \"lucide-react\"\nimport { useFormContext } from \"@rpcbase/form\"\nimport { cn, Input } from \"@rpcbase/ui\"\n\n\ntype PasswordInputProps = {\n id: string\n name?: string\n className?: string\n placeholder?: string\n autoComplete?: string\n}\n\nexport const PasswordInput = ({\n id,\n name = \"password\",\n className,\n placeholder,\n autoComplete = \"current-password\",\n}: PasswordInputProps) => {\n const [showPassword, setShowPassword] = useState(false)\n const { register, formState } = useFormContext()\n\n const fieldError = formState.errors[name as keyof typeof formState.errors]\n const errorMessage =\n typeof fieldError === \"string\"\n ? fieldError\n : typeof fieldError?.message === \"string\"\n ? fieldError.message\n : undefined\n\n const inputClassName = cn(className, \"pr-11\")\n\n return (\n <>\n <div className=\"relative\">\n <Input\n id={id}\n type={showPassword ? \"text\" : \"password\"}\n autoComplete={autoComplete}\n className={inputClassName}\n placeholder={placeholder}\n {...register(name as Parameters<typeof register>[0])}\n />\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500\"\n onClick={() => setShowPassword((prev) => !prev)}\n aria-label={showPassword ? \"Hide characters\" : \"Show characters\"}\n >\n {showPassword ? (\n <EyeOff className=\"h-5 w-5\" aria-hidden />\n ) : (\n <Eye className=\"h-5 w-5\" aria-hidden />\n )}\n </button>\n </div>\n {errorMessage ? (\n <p className=\"mt-1 -mb-2 text-sm/6 text-red-500\">{errorMessage}</p>\n ) : null}\n </>\n )\n}\n","import {useEffect, useState} from \"react\"\nimport clsx from \"clsx\"\n\n\nexport const useResendCountdown = (seconds = 60, initiallyCountingDown = true) => {\n const [remaining, setRemaining] = useState(seconds)\n const [isCountingDown, setIsCountingDown] = useState(initiallyCountingDown)\n\n useEffect(() => {\n if (!isCountingDown) return\n\n const timer = setInterval(() => {\n setRemaining((prev) => {\n if (prev <= 1) {\n setIsCountingDown(false)\n return seconds\n }\n return prev - 1\n })\n }, 1000)\n\n return () => clearInterval(timer)\n }, [isCountingDown, seconds])\n\n const restart = (nextSeconds?: number) => {\n const value = typeof nextSeconds === \"number\" ? nextSeconds : seconds\n setRemaining(value)\n setIsCountingDown(true)\n }\n\n const minutes = Math.floor(remaining / 60)\n const secs = remaining % 60\n const formatted = `${minutes}:${secs.toString().padStart(2, \"0\")}`\n\n const canResend = !isCountingDown\n\n return {remaining, formatted, isCountingDown, canResend, restart}\n}\n\n\nexport const ResendCodeButton = ({\n seconds = 60,\n onResend,\n className,\n disabled,\n}: {\n seconds?: number\n onResend?: () => Promise<void> | void\n className?: string\n disabled?: boolean\n}) => {\n const [isSending, setIsSending] = useState(false)\n const {formatted, isCountingDown, restart, canResend} = useResendCountdown(seconds)\n\n const handleClick = async () => {\n if (!canResend || isSending || disabled) return\n\n try {\n setIsSending(true)\n if (onResend) {\n await onResend()\n }\n } finally {\n restart()\n setIsSending(false)\n }\n }\n\n const isDisabled = disabled || isCountingDown || isSending\n const showCountdown = isDisabled && (isCountingDown || isSending)\n\n return (\n <span className=\"inline-flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={isDisabled}\n aria-label=\"Resend code\"\n className={clsx(\n \"text-sm font-semibold text-sky-600 hover:underline disabled:cursor-not-allowed disabled:text-gray-400\",\n className\n )}\n >\n Resend code\n </button>\n {showCountdown ? (\n <span\n data-testid=\"resend-countdown\"\n className=\"text-sm text-gray-500\"\n aria-live=\"polite\"\n >\n ({formatted})\n </span>\n ) : null}\n </span>\n )\n}\n","import { useRef, useState } from \"react\"\n\nimport { useResendCountdown } from \"./components/ResendCodeButton\"\n\n\nexport const DEFAULT_PASSWORD_RESET_COOLDOWN_SECONDS = 60\n\nexport type PasswordResetCodeRequestResult = {\n retryAfterSeconds: number\n}\n\nexport class PasswordResetCodeRequestError extends Error {\n retryAfterSeconds?: number\n errorCode?: string\n\n constructor(retryAfterSeconds?: number, errorCode?: string) {\n super(\"Unable to request a password reset code\")\n this.name = \"PasswordResetCodeRequestError\"\n this.retryAfterSeconds = retryAfterSeconds\n this.errorCode = errorCode\n }\n}\n\nconst parseRetryAfterSeconds = (value: unknown) => {\n const seconds = typeof value === \"number\" ? value : Number(value)\n if (!Number.isFinite(seconds) || seconds <= 0) return undefined\n return Math.ceil(seconds)\n}\n\nexport const requestPasswordResetCode = async(email: string): Promise<PasswordResetCodeRequestResult> => {\n const response = await fetch(\"/api/rb/auth/request-password-reset\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ email }),\n })\n\n const payload = await response.json().catch(() => null) as {\n success?: unknown\n error?: unknown\n retryAfterSeconds?: unknown\n } | null\n const retryAfterSeconds = parseRetryAfterSeconds(payload?.retryAfterSeconds)\n ?? parseRetryAfterSeconds(response.headers.get(\"Retry-After\"))\n\n if (!response.ok || payload?.success !== true) {\n const errorCode = typeof payload?.error === \"string\" ? payload.error : undefined\n throw new PasswordResetCodeRequestError(retryAfterSeconds, errorCode)\n }\n\n return {\n retryAfterSeconds: retryAfterSeconds ?? DEFAULT_PASSWORD_RESET_COOLDOWN_SECONDS,\n }\n}\n\nexport const usePasswordResetResend = ({\n email,\n cooldownSeconds = DEFAULT_PASSWORD_RESET_COOLDOWN_SECONDS,\n}: {\n email?: string | null\n cooldownSeconds?: number\n}) => {\n const countdown = useResendCountdown(cooldownSeconds)\n const [isResending, setIsResending] = useState(false)\n const isResendingRef = useRef(false)\n\n const resend = async() => {\n if (!email || !countdown.canResend || isResendingRef.current) return null\n\n isResendingRef.current = true\n setIsResending(true)\n\n try {\n const result = await requestPasswordResetCode(email)\n countdown.restart(result.retryAfterSeconds)\n return result\n } catch (error) {\n if (error instanceof PasswordResetCodeRequestError && error.retryAfterSeconds) {\n countdown.restart(error.retryAfterSeconds)\n }\n throw error\n } finally {\n isResendingRef.current = false\n setIsResending(false)\n }\n }\n\n return {\n resend,\n isResending,\n remainingSeconds: countdown.remaining,\n formatted: countdown.formatted,\n isCountingDown: countdown.isCountingDown,\n canResend: Boolean(email) && countdown.canResend && !isResending,\n }\n}\n"],"x_google_ignoreList":[7,8,9,10,11,12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1B,oBAAoBM,uBAAuBkB,SAASxB,iBAAiB,KACtEM,uBAAuBW,SAASG,QAAQS,IAAI,aAAa,CAAC;CAE/D,IAAI,CAACZ,SAASa,MAAMN,SAASG,YAAY,MAEvC,MAAM,IAAI1B,8BAA8BD,mBADtB,OAAOwB,SAASI,UAAU,WAAWJ,QAAQI,QAAQjB,KAAAA,CACH;CAGtE,OAAO,EACLX,mBAAmBA,qBAAAA,GACrB;AACF;AAEA,IAAa+B,0BAA0B,EACrChB,OACAiB,kBAAAA,SAII;CACJ,MAAMC,YAAYpC,mBAAmBmC,eAAe;CACpD,MAAM,CAACE,aAAaC,kBAAkBvC,SAAS,KAAK;CACpD,MAAMwC,iBAAiBzC,OAAO,KAAK;CAEnC,MAAM0C,SAAS,YAAW;EACxB,IAAI,CAACtB,SAAS,CAACkB,UAAUK,aAAaF,eAAeG,SAAS,OAAO;EAErEH,eAAeG,UAAU;EACzBJ,eAAe,IAAI;EAEnB,IAAI;GACF,MAAMK,SAAS,MAAM1B,yBAAyBC,KAAK;GACnDkB,UAAUQ,QAAQD,OAAOxC,iBAAiB;GAC1C,OAAOwC;EACT,SAASZ,OAAO;GACd,IAAIA,iBAAiB3B,iCAAiC2B,MAAM5B,mBAC1DiC,UAAUQ,QAAQb,MAAM5B,iBAAiB;GAE3C,MAAM4B;EACR,UAAU;GACRQ,eAAeG,UAAU;GACzBJ,eAAe,KAAK;EACtB;CACF;CAEA,OAAO;EACLE;EACAH;EACAQ,kBAAkBT,UAAUU;EAC5BC,WAAWX,UAAUW;EACrBC,gBAAgBZ,UAAUY;EAC1BP,WAAWQ,QAAQ/B,KAAK,KAAKkB,UAAUK,aAAa,CAACJ;CACvD;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["onPress","errorMessage","id","className","placeholder","__iconNode"],"sources":["../src/components/AuthLayout/index.tsx","../src/components/AppleSignInButton/index.tsx","../src/components/EmailInput/index.tsx","../src/utils/sanitizeNextPath.ts","../src/components/SignInForm/index.tsx","../src/components/SignUpForm/index.tsx","../src/components/RememberMeCheckbox/index.tsx","../../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs","../../../node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs","../../../node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs","../../../node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.mjs","../../../node_modules/lucide-react/dist/esm/defaultAttributes.mjs","../../../node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs","../../../node_modules/lucide-react/dist/esm/context.mjs","../../../node_modules/lucide-react/dist/esm/Icon.mjs","../../../node_modules/lucide-react/dist/esm/createLucideIcon.mjs","../../../node_modules/lucide-react/dist/esm/icons/eye-off.mjs","../../../node_modules/lucide-react/dist/esm/icons/eye.mjs","../src/components/PasswordInput/index.tsx","../src/components/ResendCodeButton/index.tsx","../src/passwordReset.ts"],"sourcesContent":["import * as React from \"react\"\nimport {Link, useLocation } from \"@rpcbase/router\"\n\n\nconst LINKS_REDIRECTION_MAP = {\n \"/auth/sign-in\": {\n \"title\": \"Sign Up\",\n \"location\": \"/auth/sign-up\"\n },\n \"/auth/sign-up\": {\n \"title\": \"Sign In\",\n \"location\": \"/auth/sign-in\"\n },\n \"/auth/logout-success\": {\n \"title\": \"Sign In\",\n \"location\": \"/auth/sign-in\"\n }\n}\n\ntype Pathname = keyof typeof LINKS_REDIRECTION_MAP\n\nexport const AuthLayout = ({\n sidePanel = null,\n children,\n}: {\n sidePanel: React.ReactElement | null\n children: React.ReactNode\n}) => {\n const location = useLocation()\n\n const linkTitle = LINKS_REDIRECTION_MAP[location.pathname as Pathname]?.title\n const linkLocation = LINKS_REDIRECTION_MAP[location.pathname as Pathname]?.location\n\n return (\n <div className=\"container relative flex min-h-dvh flex-col items-center justify-center px-4 py-20 sm:px-6 md:px-8 lg:grid lg:h-dvh lg:w-full lg:max-w-none lg:grid-cols-2 lg:px-0 lg:py-0\">\n {/* Top-right redirection link */}\n {linkTitle && linkLocation ? (\n <Link\n className=\"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 absolute right-4 top-4 md:right-8 md:top-8\"\n to={linkLocation}\n >\n {linkTitle}\n </Link>\n ) : null}\n <div className=\"relative hidden h-full flex-col bg-muted p-10 text-white dark:border-r lg:flex\">\n {sidePanel}\n </div>\n <div className=\"mx-auto flex w-full flex-col justify-center gap-6 /*sm:w-[350px]*/\">\n {children}\n </div>\n </div>\n )\n}\n","import clsx from \"clsx\"\n\n\nexport const AppleSignInButton = ({\n onPress,\n className,\n}: {\n onPress: () => void;\n className?: string;\n}) => {\n\n return (\n <button\n onClick={onPress}\n className={clsx(`\n w-full\n bg-black text-white hover:bg-gray-800\n flex items-center justify-center\n px-6 py-2\n rounded-lg\n font-medium\n transition duration-150 ease-in-out\n focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black\n `, className)}\n >\n <svg\n className=\"w-5 h-5 mr-3\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"white\"\n >\n <path d=\"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.539 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701\" />\n </svg>\n <span>Continue with Apple</span>\n </button>\n )\n}\n","import {useFormContext} from \"@rpcbase/form\"\nimport { Input } from \"@rpcbase/ui\"\n\n\nexport const EmailInput = ({\n id,\n className,\n placeholder,\n}: {\n id: string\n className?: string\n placeholder?: string\n}) => {\n const {register, formState} = useFormContext()\n\n const error = formState.errors.email\n let errorMessage: string | undefined\n if (typeof error === \"string\") {\n errorMessage = error\n } else if (error && typeof error.message === \"string\") {\n errorMessage = error.message\n }\n\n return (\n <>\n <Input\n id={id}\n type=\"email\"\n required\n autoComplete=\"email\"\n className={className}\n placeholder={placeholder}\n {...register(\"email\")}\n />\n {errorMessage ? (\n <p className=\"mt-1 -mb-2 text-sm/6 text-red-500\">{errorMessage}</p>\n ) : null}\n </>\n )\n}\n","const hasUnsafeNextPathChars = (value: string) => {\n for (let i = 0; i < value.length; i++) {\n const code = value.charCodeAt(i)\n if (code === 92 || code <= 31 || code === 127) return true\n }\n return false\n}\n\nexport const sanitizeNextPath = (raw: string | null) => {\n if (!raw) return null\n\n const nextPath = raw.trim()\n if (!nextPath) return null\n\n if (!nextPath.startsWith(\"/\") || nextPath.startsWith(\"//\")) {\n return null\n }\n\n if (hasUnsafeNextPathChars(nextPath)) {\n return null\n }\n\n try {\n const base = new URL(\"http://localhost\")\n const url = new URL(nextPath, base)\n if (url.origin !== base.origin) {\n return null\n }\n return `${url.pathname}${url.search}${url.hash}`\n } catch {\n return null\n }\n}\n\n","import { ReactNode } from \"react\"\nimport { useNavigate, useSearchParams } from \"@rpcbase/router\"\nimport { useForm, FormProvider, zodResolver } from \"@rpcbase/form\"\nimport type { SubmitHandler } from \"@rpcbase/form\"\nimport { z } from \"zod\"\n\nimport {requestSchema} from \"../../api/sign-in\"\nimport { sanitizeNextPath } from \"../../utils/sanitizeNextPath\"\n\n\ntype SignInFormValues = z.input<typeof requestSchema>\n\nexport const SignInForm = ({\n children,\n className\n}: {\n children: ReactNode,\n className?: string\n}) => {\n const navigate = useNavigate()\n const [searchParams] = useSearchParams()\n\n const methods = useForm<SignInFormValues>({\n defaultValues: {\n email: \"\",\n password: \"\",\n rememberMe: true,\n },\n navigationGuard: false,\n resolver: zodResolver(requestSchema)\n })\n\n const onSubmit: SubmitHandler<SignInFormValues> = async (data) => {\n methods.clearErrors(\"root\")\n\n try {\n const res = await fetch(\"/api/rb/auth/sign-in\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n credentials: \"include\",\n })\n\n const json = await res.json().catch(() => null) as { success?: boolean; error?: string } | null\n\n if (!res.ok || !json?.success) {\n const message = json?.error === \"invalid_credentials\"\n ? \"Invalid email or password.\"\n : \"Sign-in failed. Please try again.\"\n methods.setError(\"root\", { type: \"server\", message })\n return\n }\n\n const nextPath = sanitizeNextPath(searchParams.get(\"next\")) ?? \"/\"\n navigate(nextPath, { replace: true })\n } catch (err) {\n methods.setError(\"root\", { type: \"server\", message: \"Network error. Please try again.\" })\n }\n }\n\n return (\n <FormProvider {...methods}>\n <form method=\"post\" noValidate className={className} onSubmit={methods.handleSubmit(onSubmit)}>\n {children}\n {methods.formState.errors.root?.message && (\n <p className=\"mt-2 text-sm text-red-600\" role=\"alert\">\n {methods.formState.errors.root.message}\n </p>\n )}\n </form>\n </FormProvider>\n )\n}\n","import {ReactNode, useState} from \"react\"\nimport { useNavigate } from \"@rpcbase/router\"\nimport { useForm, FormProvider, zodResolver } from \"@rpcbase/form\"\nimport type {SubmitHandler} from \"@rpcbase/form\"\nimport { z } from \"zod\"\n\nimport {requestSchema} from \"../../api/sign-up\"\n\n\ntype SignUpFormValues = z.input<typeof requestSchema>\n\n\nexport const SignUpForm = ({\n children,\n className,\n otpNextPath\n}: {\n children: ReactNode,\n className?: string\n otpNextPath?: string\n}) => {\n\n const navigate = useNavigate()\n\n const [serverMessage, setServerMessage] = useState<string | null>(null)\n const methods = useForm<SignUpFormValues>({\n defaultValues: {\n email: \"\",\n password: \"\",\n rememberMe: true,\n },\n navigationGuard: false,\n resolver: zodResolver(requestSchema)\n })\n\n const onSubmit: SubmitHandler<SignUpFormValues> = async (data) => {\n setServerMessage(null)\n methods.clearErrors(\"root\")\n\n try {\n const res = await fetch(\"/api/rb/auth/sign-up\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n credentials: \"include\",\n })\n\n const json = await res.json()\n\n if (!res.ok) {\n const message = json.error === \"user_exists\"\n ? \"An account already exists with this email.\"\n : \"Sign-up failed. Please try again.\"\n methods.setError(\"root\", { type: \"server\", message })\n return\n }\n\n if (!json.success) {\n methods.setError(\"root\", { type: \"server\", message: \"Sign-up failed. Please try again.\" })\n return\n }\n\n const search = new URLSearchParams({ email: data.email })\n if (otpNextPath) {\n search.set(\"next\", otpNextPath)\n }\n navigate(`/auth/sign-up-otp?${search.toString()}`)\n setServerMessage(\"Account created. Check your inbox to verify your email.\")\n } catch (err) {\n methods.setError(\"root\", { type: \"server\", message: \"Network error. Please try again.\" })\n }\n }\n\n return (\n <FormProvider {...methods}>\n <form method=\"post\" noValidate className={className} onSubmit={methods.handleSubmit(onSubmit)}>\n {children}\n {methods.formState.errors.root?.message && (\n <p className=\"mt-2 text-sm text-red-600\" role=\"alert\">\n {methods.formState.errors.root.message}\n </p>\n )}\n {serverMessage && (\n <p className=\"mt-2 text-sm text-green-700\" role=\"status\">\n {serverMessage}\n </p>\n )}\n </form>\n </FormProvider>\n )\n}\n","import type { ElementType } from \"react\"\nimport {useFormContext} from \"@rpcbase/form\"\n\n\nexport const RememberMeCheckbox = ({\n label,\n as: Component = \"input\"\n}: {\n label: string,\n as?: ElementType\n}) => {\n const {register} = useFormContext()\n\n return (\n <>\n <Component\n id=\"rememberMe\"\n {...register(\"rememberMe\")}\n />\n <label\n htmlFor={\"rememberMe\"}\n className=\"pl-2 block text-sm/6 text-gray-900\"\n >\n {label}\n </label>\n </>\n )\n}\n","/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst mergeClasses = (...classes) => classes.filter((className, index, array) => {\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n}).join(\" \").trim();\n\nexport { mergeClasses };\n//# sourceMappingURL=mergeClasses.mjs.map\n","/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\n\nexport { toKebabCase };\n//# sourceMappingURL=toKebabCase.mjs.map\n","/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toCamelCase = (string) => string.replace(\n /^([A-Z])|[\\s-_]+(\\w)/g,\n (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()\n);\n\nexport { toCamelCase };\n//# sourceMappingURL=toCamelCase.mjs.map\n","/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { toCamelCase } from './toCamelCase.mjs';\n\nconst toPascalCase = (string) => {\n const camelCase = toCamelCase(string);\n return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);\n};\n\nexport { toPascalCase };\n//# sourceMappingURL=toPascalCase.mjs.map\n","/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nvar defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.mjs.map\n","/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst hasA11yProp = (props) => {\n for (const prop in props) {\n if (prop.startsWith(\"aria-\") || prop === \"role\" || prop === \"title\") {\n return true;\n }\n }\n return false;\n};\n\nexport { hasA11yProp };\n//# sourceMappingURL=hasA11yProp.mjs.map\n","\"use strict\";\n\"use client\";\n/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { createContext, useContext, useMemo, createElement } from 'react';\n\nconst LucideContext = createContext({});\nfunction LucideProvider({\n children,\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n className\n}) {\n const value = useMemo(\n () => ({\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n className\n }),\n [size, color, strokeWidth, absoluteStrokeWidth, className]\n );\n return createElement(LucideContext.Provider, { value }, children);\n}\nconst useLucideContext = () => useContext(LucideContext);\n\nexport { LucideProvider, useLucideContext };\n//# sourceMappingURL=context.mjs.map\n","\"use strict\";\n\"use client\";\n/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.mjs';\nimport { hasA11yProp } from './shared/src/utils/hasA11yProp.mjs';\nimport { mergeClasses } from './shared/src/utils/mergeClasses.mjs';\nimport { useLucideContext } from './context.mjs';\n\nconst Icon = forwardRef(\n ({ color, size, strokeWidth, absoluteStrokeWidth, className = \"\", children, iconNode, ...rest }, ref) => {\n const {\n size: contextSize = 24,\n strokeWidth: contextStrokeWidth = 2,\n absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,\n color: contextColor = \"currentColor\",\n className: contextClass = \"\"\n } = useLucideContext() ?? {};\n const calculatedStrokeWidth = absoluteStrokeWidth ?? contextAbsoluteStrokeWidth ? Number(strokeWidth ?? contextStrokeWidth) * 24 / Number(size ?? contextSize) : strokeWidth ?? contextStrokeWidth;\n return createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size ?? contextSize ?? defaultAttributes.width,\n height: size ?? contextSize ?? defaultAttributes.height,\n stroke: color ?? contextColor,\n strokeWidth: calculatedStrokeWidth,\n className: mergeClasses(\"lucide\", contextClass, className),\n ...!children && !hasA11yProp(rest) && { \"aria-hidden\": \"true\" },\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n );\n }\n);\n\nexport { Icon as default };\n//# sourceMappingURL=Icon.mjs.map\n","/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { mergeClasses } from './shared/src/utils/mergeClasses.mjs';\nimport { toKebabCase } from './shared/src/utils/toKebabCase.mjs';\nimport { toPascalCase } from './shared/src/utils/toPascalCase.mjs';\nimport Icon from './Icon.mjs';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({ className, ...props }, ref) => createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(\n `lucide-${toKebabCase(toPascalCase(iconName))}`,\n `lucide-${iconName}`,\n className\n ),\n ...props\n })\n );\n Component.displayName = toPascalCase(iconName);\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.mjs.map\n","/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n key: \"ct8e1f\"\n }\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\", key: \"151rxh\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n key: \"13bj9a\"\n }\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n];\nconst EyeOff = createLucideIcon(\"eye-off\", __iconNode);\n\nexport { __iconNode, EyeOff as default };\n//# sourceMappingURL=eye-off.mjs.map\n","/**\n * @license lucide-react v1.34.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Eye = createLucideIcon(\"eye\", __iconNode);\n\nexport { __iconNode, Eye as default };\n//# sourceMappingURL=eye.mjs.map\n","import { useState } from \"react\"\nimport { Eye, EyeOff } from \"lucide-react\"\nimport { useFormContext } from \"@rpcbase/form\"\nimport { cn, Input } from \"@rpcbase/ui\"\n\n\ntype PasswordInputProps = {\n id: string\n name?: string\n className?: string\n placeholder?: string\n autoComplete?: string\n}\n\nexport const PasswordInput = ({\n id,\n name = \"password\",\n className,\n placeholder,\n autoComplete = \"current-password\",\n}: PasswordInputProps) => {\n const [showPassword, setShowPassword] = useState(false)\n const { register, formState } = useFormContext()\n\n const fieldError = formState.errors[name as keyof typeof formState.errors]\n const errorMessage =\n typeof fieldError === \"string\"\n ? fieldError\n : typeof fieldError?.message === \"string\"\n ? fieldError.message\n : undefined\n\n const inputClassName = cn(className, \"pr-11\")\n\n return (\n <>\n <div className=\"relative\">\n <Input\n id={id}\n type={showPassword ? \"text\" : \"password\"}\n autoComplete={autoComplete}\n className={inputClassName}\n placeholder={placeholder}\n {...register(name as Parameters<typeof register>[0])}\n />\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500\"\n onClick={() => setShowPassword((prev) => !prev)}\n aria-label={showPassword ? \"Hide characters\" : \"Show characters\"}\n >\n {showPassword ? (\n <EyeOff className=\"h-5 w-5\" aria-hidden />\n ) : (\n <Eye className=\"h-5 w-5\" aria-hidden />\n )}\n </button>\n </div>\n {errorMessage ? (\n <p className=\"mt-1 -mb-2 text-sm/6 text-red-500\">{errorMessage}</p>\n ) : null}\n </>\n )\n}\n","import {useEffect, useState} from \"react\"\nimport clsx from \"clsx\"\n\n\nexport const useResendCountdown = (seconds = 60, initiallyCountingDown = true) => {\n const [remaining, setRemaining] = useState(seconds)\n const [isCountingDown, setIsCountingDown] = useState(initiallyCountingDown)\n\n useEffect(() => {\n if (!isCountingDown) return\n\n const timer = setInterval(() => {\n setRemaining((prev) => {\n if (prev <= 1) {\n setIsCountingDown(false)\n return seconds\n }\n return prev - 1\n })\n }, 1000)\n\n return () => clearInterval(timer)\n }, [isCountingDown, seconds])\n\n const restart = (nextSeconds?: number) => {\n const value = typeof nextSeconds === \"number\" ? nextSeconds : seconds\n setRemaining(value)\n setIsCountingDown(true)\n }\n\n const minutes = Math.floor(remaining / 60)\n const secs = remaining % 60\n const formatted = `${minutes}:${secs.toString().padStart(2, \"0\")}`\n\n const canResend = !isCountingDown\n\n return {remaining, formatted, isCountingDown, canResend, restart}\n}\n\n\nexport const ResendCodeButton = ({\n seconds = 60,\n onResend,\n className,\n disabled,\n}: {\n seconds?: number\n onResend?: () => Promise<void> | void\n className?: string\n disabled?: boolean\n}) => {\n const [isSending, setIsSending] = useState(false)\n const {formatted, isCountingDown, restart, canResend} = useResendCountdown(seconds)\n\n const handleClick = async () => {\n if (!canResend || isSending || disabled) return\n\n try {\n setIsSending(true)\n if (onResend) {\n await onResend()\n }\n } finally {\n restart()\n setIsSending(false)\n }\n }\n\n const isDisabled = disabled || isCountingDown || isSending\n const showCountdown = isDisabled && (isCountingDown || isSending)\n\n return (\n <span className=\"inline-flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={isDisabled}\n aria-label=\"Resend code\"\n className={clsx(\n \"text-sm font-semibold text-sky-600 hover:underline disabled:cursor-not-allowed disabled:text-gray-400\",\n className\n )}\n >\n Resend code\n </button>\n {showCountdown ? (\n <span\n data-testid=\"resend-countdown\"\n className=\"text-sm text-gray-500\"\n aria-live=\"polite\"\n >\n ({formatted})\n </span>\n ) : null}\n </span>\n )\n}\n","import { useRef, useState } from \"react\"\n\nimport { useResendCountdown } from \"./components/ResendCodeButton\"\n\n\nexport const DEFAULT_PASSWORD_RESET_COOLDOWN_SECONDS = 60\n\nexport type PasswordResetCodeRequestResult = {\n retryAfterSeconds: number\n}\n\nexport class PasswordResetCodeRequestError extends Error {\n retryAfterSeconds?: number\n errorCode?: string\n\n constructor(retryAfterSeconds?: number, errorCode?: string) {\n super(\"Unable to request a password reset code\")\n this.name = \"PasswordResetCodeRequestError\"\n this.retryAfterSeconds = retryAfterSeconds\n this.errorCode = errorCode\n }\n}\n\nconst parseRetryAfterSeconds = (value: unknown) => {\n const seconds = typeof value === \"number\" ? value : Number(value)\n if (!Number.isFinite(seconds) || seconds <= 0) return undefined\n return Math.ceil(seconds)\n}\n\nexport const requestPasswordResetCode = async(email: string): Promise<PasswordResetCodeRequestResult> => {\n const response = await fetch(\"/api/rb/auth/request-password-reset\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ email }),\n })\n\n const payload = await response.json().catch(() => null) as {\n success?: unknown\n error?: unknown\n retryAfterSeconds?: unknown\n } | null\n const retryAfterSeconds = parseRetryAfterSeconds(payload?.retryAfterSeconds)\n ?? parseRetryAfterSeconds(response.headers.get(\"Retry-After\"))\n\n if (!response.ok || payload?.success !== true) {\n const errorCode = typeof payload?.error === \"string\" ? payload.error : undefined\n throw new PasswordResetCodeRequestError(retryAfterSeconds, errorCode)\n }\n\n return {\n retryAfterSeconds: retryAfterSeconds ?? DEFAULT_PASSWORD_RESET_COOLDOWN_SECONDS,\n }\n}\n\nexport const usePasswordResetResend = ({\n email,\n cooldownSeconds = DEFAULT_PASSWORD_RESET_COOLDOWN_SECONDS,\n}: {\n email?: string | null\n cooldownSeconds?: number\n}) => {\n const countdown = useResendCountdown(cooldownSeconds)\n const [isResending, setIsResending] = useState(false)\n const isResendingRef = useRef(false)\n\n const resend = async() => {\n if (!email || !countdown.canResend || isResendingRef.current) return null\n\n isResendingRef.current = true\n setIsResending(true)\n\n try {\n const result = await requestPasswordResetCode(email)\n countdown.restart(result.retryAfterSeconds)\n return result\n } catch (error) {\n if (error instanceof PasswordResetCodeRequestError && error.retryAfterSeconds) {\n countdown.restart(error.retryAfterSeconds)\n }\n throw error\n } finally {\n isResendingRef.current = false\n setIsResending(false)\n }\n }\n\n return {\n resend,\n isResending,\n remainingSeconds: countdown.remaining,\n formatted: countdown.formatted,\n isCountingDown: countdown.isCountingDown,\n canResend: Boolean(email) && countdown.canResend && !isResending,\n }\n}\n"],"x_google_ignoreList":[7,8,9,10,11,12,13,14,15,16,17],"mappings":";;;;;;;;;;;AAIA,IAAM,wBAAwB;CAC5B,iBAAiB;EACf,SAAS;EACT,YAAY;CACd;CACA,iBAAiB;EACf,SAAS;EACT,YAAY;CACd;CACA,wBAAwB;EACtB,SAAS;EACT,YAAY;CACd;AACF;AAIA,IAAa,cAAc,EACzB,YAAY,MACZ,eAII;CACJ,MAAM,WAAW,YAAY;CAE7B,MAAM,YAAY,sBAAsB,SAAS,SAAqB,EAAE;CACxE,MAAM,eAAe,sBAAsB,SAAS,SAAqB,EAAE;CAE3E,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GAEG,aAAa,eACZ,oBAAC,MAAD;IACE,WAAU;IACV,IAAI;IAEH,UAAA;GACG,CAAA,IACJ;GACJ,oBAAC,OAAD;IAAK,WAAU;IACZ,UAAA;GACE,CAAA;GACL,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B,UAAU;EAC1B,WAAW,QAAQ,KAAK,KAAK,UAAU,aAAa,CAAC;CACvD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware-BT3Uput1.js","names":[
|
|
1
|
+
{"version":3,"file":"middleware-BT3Uput1.js","names":[],"sources":["../src/middleware.ts"],"sourcesContent":["import type { Middleware } from \"@rpcbase/api\"\n\nimport type { AuthSessionUser } from \"./types\"\n\n\nconst isAuthenticated = (req: Parameters<Middleware>[0]): req is Parameters<Middleware<AuthSessionUser>>[0] => {\n const sessionUser = req.session?.user as { id?: unknown } | undefined\n return Boolean(sessionUser?.id)\n}\n\nexport const restrictSessionMiddleware: Middleware<AuthSessionUser> = (req, res, next) => {\n if (isAuthenticated(req)) {\n return next()\n }\n\n res.status(401).json({ error: \"unauthorized\" })\n}\n\nexport const requireSession = restrictSessionMiddleware\n\nexport const redirectAuthMiddleware: Middleware<AuthSessionUser> = (req, res, next) => {\n if (req.path.startsWith(\"/app\") && !isAuthenticated(req)) {\n return res.redirect(\"/auth/sign-in\")\n }\n\n next()\n}\n"],"mappings":";AAKA,IAAM,mBAAmB,QAAsF;CAC7G,MAAM,cAAc,IAAI,SAAS;CACjC,OAAO,QAAQ,aAAa,EAAE;AAChC;AAEA,IAAa,6BAA0D,KAAK,KAAK,SAAS;CACxF,IAAI,gBAAgB,GAAG,GACrB,OAAO,KAAK;CAGd,IAAI,OAAO,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,eAAe,CAAC;AAChD;AAEA,IAAa,iBAAiB;AAE9B,IAAa,0BAAuD,KAAK,KAAK,SAAS;CACrF,IAAI,IAAI,KAAK,WAAW,MAAM,KAAK,CAAC,gBAAgB,GAAG,GACrD,OAAO,IAAI,SAAS,eAAe;CAGrC,KAAK;AACP"}
|
package/dist/oauth/index.js
CHANGED
|
@@ -141,7 +141,7 @@ var isSafeOAuthProviderId = (value) => {
|
|
|
141
141
|
};
|
|
142
142
|
//#endregion
|
|
143
143
|
//#region src/oauth/lib.ts
|
|
144
|
-
var OAUTH_REQUEST_TTL_MS =
|
|
144
|
+
var OAUTH_REQUEST_TTL_MS = 6e5;
|
|
145
145
|
var OAUTH_STATE_COOKIE_NAME = "rb_oauth_state";
|
|
146
146
|
var getQueryString = (value) => {
|
|
147
147
|
if (typeof value === "string") return value;
|
|
@@ -648,7 +648,7 @@ var createAppleClientSecret = ({ teamId, clientId, keyId, privateKeyPem, now = /
|
|
|
648
648
|
if (!keyIdValue) throw new Error("keyId is required");
|
|
649
649
|
if (!privateKeyPemValue) throw new Error("privateKeyPem is required");
|
|
650
650
|
const nowSeconds = Math.floor(now.getTime() / 1e3);
|
|
651
|
-
const exp = nowSeconds + Math.max(60, Math.min(Number.isFinite(expiresInSeconds) ? expiresInSeconds : 600,
|
|
651
|
+
const exp = nowSeconds + Math.max(60, Math.min(Number.isFinite(expiresInSeconds) ? expiresInSeconds : 600, 15552e3));
|
|
652
652
|
const header = {
|
|
653
653
|
alg: "ES256",
|
|
654
654
|
kid: keyIdValue,
|