@arch-cadre/auth 1.0.7 → 1.0.9

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 (57) hide show
  1. package/dist/actions/basic.d.ts +1 -1
  2. package/dist/actions/email.d.ts +1 -1
  3. package/dist/actions/index.cjs +2 -2
  4. package/dist/actions/index.d.ts +2 -2
  5. package/dist/actions/index.mjs +2 -2
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.mjs +1 -1
  8. package/dist/routes.cjs +7 -7
  9. package/dist/routes.mjs +7 -7
  10. package/dist/ui/forgot-password/components.cjs +2 -2
  11. package/dist/ui/forgot-password/components.mjs +2 -2
  12. package/dist/ui/forgot-password/page.cjs +1 -1
  13. package/dist/ui/forgot-password/page.mjs +1 -1
  14. package/dist/ui/reset-password/components.cjs +2 -2
  15. package/dist/ui/reset-password/components.mjs +2 -2
  16. package/dist/ui/reset-password/page.cjs +1 -1
  17. package/dist/ui/reset-password/page.mjs +1 -1
  18. package/dist/ui/reset-password/verify-email/components.cjs +2 -2
  19. package/dist/ui/reset-password/verify-email/components.mjs +2 -2
  20. package/dist/ui/reset-password/verify-email/page.cjs +1 -1
  21. package/dist/ui/reset-password/verify-email/page.mjs +1 -1
  22. package/dist/ui/signin/components.cjs +2 -2
  23. package/dist/ui/signin/components.d.ts +1 -1
  24. package/dist/ui/signin/components.mjs +2 -2
  25. package/dist/ui/signin/page.cjs +1 -1
  26. package/dist/ui/signin/page.mjs +1 -1
  27. package/dist/ui/signup/components.cjs +2 -2
  28. package/dist/ui/signup/components.d.ts +1 -1
  29. package/dist/ui/signup/components.mjs +2 -2
  30. package/dist/ui/signup/page.cjs +1 -1
  31. package/dist/ui/signup/page.mjs +1 -1
  32. package/dist/ui/verify-email/components.cjs +2 -2
  33. package/dist/ui/verify-email/components.mjs +2 -2
  34. package/dist/ui/verify-email/page.cjs +1 -1
  35. package/dist/ui/verify-email/page.mjs +1 -1
  36. package/package.json +8 -7
  37. package/src/actions/basic.ts +53 -0
  38. package/src/actions/email.ts +241 -0
  39. package/src/actions/index.ts +2 -0
  40. package/src/index.ts +13 -0
  41. package/src/intl.d.ts +13 -0
  42. package/src/routes.ts +55 -0
  43. package/src/types.ts +12 -0
  44. package/src/ui/forgot-password/components.tsx +101 -0
  45. package/src/ui/forgot-password/page.tsx +6 -0
  46. package/src/ui/layout.tsx +42 -0
  47. package/src/ui/reset-password/components.tsx +128 -0
  48. package/src/ui/reset-password/page.tsx +25 -0
  49. package/src/ui/reset-password/verify-email/components.tsx +110 -0
  50. package/src/ui/reset-password/verify-email/page.tsx +25 -0
  51. package/src/ui/signin/components.tsx +215 -0
  52. package/src/ui/signin/page.tsx +43 -0
  53. package/src/ui/signup/components.tsx +230 -0
  54. package/src/ui/signup/page.tsx +35 -0
  55. package/src/ui/verify-email/components.tsx +135 -0
  56. package/src/ui/verify-email/page.tsx +36 -0
  57. package/src/validation.ts +61 -0
@@ -1,5 +1,5 @@
1
1
  import type { LoginInput, RegisterInput } from "@arch-cadre/core";
2
- import type { ActionResult } from "../types";
2
+ import type { ActionResult } from "../types.js";
3
3
  /**
4
4
  * Modern Login Action delegating to Core Auth
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import type { ForgotPasswordInput, ResetPasswordInput, VerifyEmailInput } from "@arch-cadre/core";
2
- import type { ActionResult } from "../types";
2
+ import type { ActionResult } from "../types.js";
3
3
  export declare function forgotPasswordAction(data: ForgotPasswordInput): Promise<ActionResult>;
4
4
  export declare function verifyPasswordResetEmailAction(data: VerifyEmailInput): Promise<ActionResult>;
5
5
  export declare function verifyEmailAction(data: VerifyEmailInput): Promise<ActionResult>;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _basic = require("./basic.cjs");
6
+ var _basic = require("./basic.js");
7
7
  Object.keys(_basic).forEach(function (key) {
8
8
  if (key === "default" || key === "__esModule") return;
9
9
  if (key in exports && exports[key] === _basic[key]) return;
@@ -14,7 +14,7 @@ Object.keys(_basic).forEach(function (key) {
14
14
  }
15
15
  });
16
16
  });
17
- var _email = require("./email.cjs");
17
+ var _email = require("./email.js");
18
18
  Object.keys(_email).forEach(function (key) {
19
19
  if (key === "default" || key === "__esModule") return;
20
20
  if (key in exports && exports[key] === _email[key]) return;
@@ -1,2 +1,2 @@
1
- export * from "./basic";
2
- export * from "./email";
1
+ export * from "./basic.js";
2
+ export * from "./email.js";
@@ -1,2 +1,2 @@
1
- export * from "./basic.mjs";
2
- export * from "./email.mjs";
1
+ export * from "./basic.js";
2
+ export * from "./email.js";
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
 
7
7
  var _manifest = _interopRequireDefault(require("../manifest.json"));
8
- var _routes = require("./routes.cjs");
8
+ var _routes = require("./routes.js");
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
10
  const authModule = {
11
11
  manifest: _manifest.default,
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import manifest from "../manifest.json";
2
- import { publicRoutes } from "./routes.mjs";
2
+ import { publicRoutes } from "./routes.js";
3
3
  const authModule = {
4
4
  manifest,
5
5
  routes: {
package/dist/routes.cjs CHANGED
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.publicRoutes = void 0;
7
7
  var _dynamic = _interopRequireDefault(require("next/dynamic"));
8
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const AuthLayout = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/layout.cjs")));
10
- const SignInPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/signin/page.cjs")));
11
- const SignUpPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/signup/page.cjs")));
12
- const ForgotPasswordPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/forgot-password/page.cjs")));
13
- const ResetPasswordPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/reset-password/page.cjs")));
14
- const VerifyEmailPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/verify-email/page.cjs")));
15
- const ResetPasswordVerifyEmailPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/reset-password/verify-email/page.cjs")));
9
+ const AuthLayout = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/layout.js")));
10
+ const SignInPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/signin/page.js")));
11
+ const SignUpPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/signup/page.js")));
12
+ const ForgotPasswordPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/forgot-password/page.js")));
13
+ const ResetPasswordPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/reset-password/page.js")));
14
+ const VerifyEmailPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/verify-email/page.js")));
15
+ const ResetPasswordVerifyEmailPage = (0, _dynamic.default)(() => Promise.resolve().then(() => require("./ui/reset-password/verify-email/page.js")));
16
16
  const publicRoutes = exports.publicRoutes = [{
17
17
  path: "/signin",
18
18
  component: SignInPage,
package/dist/routes.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import dynamic from "next/dynamic";
2
- const AuthLayout = dynamic(() => import("./ui/layout.mjs"));
3
- const SignInPage = dynamic(() => import("./ui/signin/page.mjs"));
4
- const SignUpPage = dynamic(() => import("./ui/signup/page.mjs"));
5
- const ForgotPasswordPage = dynamic(() => import("./ui/forgot-password/page.mjs"));
6
- const ResetPasswordPage = dynamic(() => import("./ui/reset-password/page.mjs"));
7
- const VerifyEmailPage = dynamic(() => import("./ui/verify-email/page.mjs"));
2
+ const AuthLayout = dynamic(() => import("./ui/layout.js"));
3
+ const SignInPage = dynamic(() => import("./ui/signin/page.js"));
4
+ const SignUpPage = dynamic(() => import("./ui/signup/page.js"));
5
+ const ForgotPasswordPage = dynamic(() => import("./ui/forgot-password/page.js"));
6
+ const ResetPasswordPage = dynamic(() => import("./ui/reset-password/page.js"));
7
+ const VerifyEmailPage = dynamic(() => import("./ui/verify-email/page.js"));
8
8
  const ResetPasswordVerifyEmailPage = dynamic(
9
- () => import("./ui/reset-password/verify-email/page.mjs")
9
+ () => import("./ui/reset-password/verify-email/page.js")
10
10
  );
11
11
  export const publicRoutes = [
12
12
  {
@@ -18,8 +18,8 @@ var _react = _interopRequireWildcard(require("react"));
18
18
  var React = _react;
19
19
  var _reactHookForm = require("react-hook-form");
20
20
  var _sonner = require("sonner");
21
- var _index = require("../../actions/index.cjs");
22
- var _validation = require("../../validation.cjs");
21
+ var _index = require("../../actions/index.js");
22
+ var _validation = require("../../validation.js");
23
23
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
24
24
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
25
  function ForgotPasswordForm() {
@@ -12,10 +12,10 @@ import * as React from "react";
12
12
  import { useState } from "react";
13
13
  import { Controller, useForm } from "react-hook-form";
14
14
  import { toast } from "sonner";
15
- import { forgotPasswordAction } from "../../actions/index.mjs";
15
+ import { forgotPasswordAction } from "../../actions/index.js";
16
16
  import {
17
17
  forgotPasswordSchema
18
- } from "../../validation.mjs";
18
+ } from "../../validation.js";
19
19
  export function ForgotPasswordForm() {
20
20
  const [generalError, setGeneralError] = useState("");
21
21
  const { t } = useTranslation();
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  module.exports = Page;
7
7
  var React = _interopRequireWildcard(require("react"));
8
- var _components = require("./components.cjs");
8
+ var _components = require("./components.js");
9
9
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
10
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
11
  async function Page() {
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { ForgotPasswordForm } from "./components.mjs";
2
+ import { ForgotPasswordForm } from "./components.js";
3
3
  export default async function Page() {
4
4
  return /* @__PURE__ */ React.createElement(ForgotPasswordForm, null);
5
5
  }
@@ -19,8 +19,8 @@ var _react = _interopRequireWildcard(require("react"));
19
19
  var React = _react;
20
20
  var _reactHookForm = require("react-hook-form");
21
21
  var _sonner = require("sonner");
22
- var _index = require("../../actions/index.cjs");
23
- var _validation = require("../../validation.cjs");
22
+ var _index = require("../../actions/index.js");
23
+ var _validation = require("../../validation.js");
24
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
25
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
26
26
  function ResetPasswordForm() {
@@ -21,8 +21,8 @@ import * as React from "react";
21
21
  import { useState } from "react";
22
22
  import { Controller, useForm } from "react-hook-form";
23
23
  import { toast } from "sonner";
24
- import { resetPasswordAction } from "../../actions/index.mjs";
25
- import { resetPasswordSchema } from "../../validation.mjs";
24
+ import { resetPasswordAction } from "../../actions/index.js";
25
+ import { resetPasswordSchema } from "../../validation.js";
26
26
  export function ResetPasswordForm() {
27
27
  const [generalError, setGeneralError] = useState("");
28
28
  const { t } = useTranslation();
@@ -7,7 +7,7 @@ module.exports = Page;
7
7
  var _server = require("@arch-cadre/core/server");
8
8
  var _navigation = require("next/navigation");
9
9
  var React = _interopRequireWildcard(require("react"));
10
- var _components = require("./components.cjs");
10
+ var _components = require("./components.js");
11
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
12
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
13
  async function Page() {
@@ -4,7 +4,7 @@ import {
4
4
  } from "@arch-cadre/core/server";
5
5
  import { redirect } from "next/navigation";
6
6
  import * as React from "react";
7
- import { ResetPasswordForm } from "./components.mjs";
7
+ import { ResetPasswordForm } from "./components.js";
8
8
  export default async function Page() {
9
9
  const { session, user } = await getCurrentPasswordResetSession();
10
10
  if (session === null || user === null) {
@@ -17,8 +17,8 @@ var _react = _interopRequireWildcard(require("react"));
17
17
  var React = _react;
18
18
  var _reactHookForm = require("react-hook-form");
19
19
  var _sonner = require("sonner");
20
- var _index = require("../../../actions/index.cjs");
21
- var _validation = require("../../../validation.cjs");
20
+ var _index = require("../../../actions/index.js");
21
+ var _validation = require("../../../validation.js");
22
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
23
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
24
  function PasswordResetEmailVerificationForm({
@@ -19,8 +19,8 @@ import * as React from "react";
19
19
  import { useState } from "react";
20
20
  import { Controller, useForm } from "react-hook-form";
21
21
  import { toast } from "sonner";
22
- import { verifyPasswordResetEmailAction } from "../../../actions/index.mjs";
23
- import { verifyEmailSchema } from "../../../validation.mjs";
22
+ import { verifyPasswordResetEmailAction } from "../../../actions/index.js";
23
+ import { verifyEmailSchema } from "../../../validation.js";
24
24
  export function PasswordResetEmailVerificationForm({ email = "" }) {
25
25
  const [generalError, setGeneralError] = useState("");
26
26
  const { t } = useTranslation();
@@ -7,7 +7,7 @@ module.exports = Page;
7
7
  var _server = require("@arch-cadre/core/server");
8
8
  var _navigation = require("next/navigation");
9
9
  var React = _interopRequireWildcard(require("react"));
10
- var _components = require("./components.cjs");
10
+ var _components = require("./components.js");
11
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
12
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
13
  async function Page() {
@@ -4,7 +4,7 @@ import {
4
4
  } from "@arch-cadre/core/server";
5
5
  import { redirect } from "next/navigation";
6
6
  import * as React from "react";
7
- import { PasswordResetEmailVerificationForm } from "./components.mjs";
7
+ import { PasswordResetEmailVerificationForm } from "./components.js";
8
8
  export default async function Page() {
9
9
  const { session, user } = await getCurrentPasswordResetSession();
10
10
  if (session === null || user === null) {
@@ -21,8 +21,8 @@ var _react = _interopRequireWildcard(require("react"));
21
21
  var React = _react;
22
22
  var _reactHookForm = require("react-hook-form");
23
23
  var _sonner = require("sonner");
24
- var _index = require("../../actions/index.cjs");
25
- var _validation = require("../../validation.cjs");
24
+ var _index = require("../../actions/index.js");
25
+ var _validation = require("../../validation.js");
26
26
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
27
27
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
28
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { UseFormReturn } from "react-hook-form";
3
- import { type LoginInput } from "../../validation";
3
+ import { type LoginInput } from "../../validation.js";
4
4
  export declare function useLoginForm(): {
5
5
  form: UseFormReturn<LoginInput>;
6
6
  };
@@ -19,8 +19,8 @@ import * as React from "react";
19
19
  import { createContext, useContext, useState } from "react";
20
20
  import { Controller, useForm } from "react-hook-form";
21
21
  import { toast } from "sonner";
22
- import { loginAction } from "../../actions/index.mjs";
23
- import { loginSchema } from "../../validation.mjs";
22
+ import { loginAction } from "../../actions/index.js";
23
+ import { loginSchema } from "../../validation.js";
24
24
  const LoginFormContext = createContext(null);
25
25
  export function useLoginForm() {
26
26
  const context = useContext(LoginFormContext);
@@ -9,7 +9,7 @@ var _modules = require("@arch-cadre/modules");
9
9
  var _server2 = require("@arch-cadre/modules/server");
10
10
  var _navigation = require("next/navigation");
11
11
  var React = _interopRequireWildcard(require("react"));
12
- var _components = require("./components.cjs");
12
+ var _components = require("./components.js");
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  async function Page() {
@@ -3,7 +3,7 @@ import { ExtensionPoint } from "@arch-cadre/modules";
3
3
  import { hasExtension } from "@arch-cadre/modules/server";
4
4
  import { redirect } from "next/navigation";
5
5
  import * as React from "react";
6
- import { LoginForm } from "./components.mjs";
6
+ import { LoginForm } from "./components.js";
7
7
  export default async function Page() {
8
8
  const { session, user } = await getCurrentSession();
9
9
  if (session !== null && user !== null) {
@@ -21,8 +21,8 @@ var _react = _interopRequireWildcard(require("react"));
21
21
  var React = _react;
22
22
  var _reactHookForm = require("react-hook-form");
23
23
  var _sonner = require("sonner");
24
- var _index = require("../../actions/index.cjs");
25
- var _validation = require("../../validation.cjs");
24
+ var _index = require("../../actions/index.js");
25
+ var _validation = require("../../validation.js");
26
26
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
27
27
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
28
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { UseFormReturn } from "react-hook-form";
3
- import { type RegisterInput } from "../../validation";
3
+ import { type RegisterInput } from "../../validation.js";
4
4
  export declare function useSignUpForm(): {
5
5
  form: UseFormReturn<RegisterInput>;
6
6
  };
@@ -19,8 +19,8 @@ import * as React from "react";
19
19
  import { createContext, useContext, useState } from "react";
20
20
  import { Controller, useForm } from "react-hook-form";
21
21
  import { toast } from "sonner";
22
- import { signupAction } from "../../actions/index.mjs";
23
- import { registerSchema } from "../../validation.mjs";
22
+ import { signupAction } from "../../actions/index.js";
23
+ import { registerSchema } from "../../validation.js";
24
24
  const SignUpFormContext = createContext(null);
25
25
  export function useSignUpForm() {
26
26
  const context = useContext(SignUpFormContext);
@@ -9,7 +9,7 @@ var _modules = require("@arch-cadre/modules");
9
9
  var _server2 = require("@arch-cadre/modules/server");
10
10
  var _navigation = require("next/navigation");
11
11
  var React = _interopRequireWildcard(require("react"));
12
- var _components = require("./components.cjs");
12
+ var _components = require("./components.js");
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  async function Page() {
@@ -3,7 +3,7 @@ import { ExtensionPoint } from "@arch-cadre/modules";
3
3
  import { hasExtension } from "@arch-cadre/modules/server";
4
4
  import { redirect } from "next/navigation";
5
5
  import * as React from "react";
6
- import { SignUpForm } from "./components.mjs";
6
+ import { SignUpForm } from "./components.js";
7
7
  export default async function Page() {
8
8
  const { session, user } = await getCurrentSession();
9
9
  if (session !== null && user !== null) {
@@ -17,8 +17,8 @@ var _lucideReact = require("lucide-react");
17
17
  var _react = _interopRequireWildcard(require("react"));
18
18
  var _reactHookForm = require("react-hook-form");
19
19
  var _sonner = require("sonner");
20
- var _index = require("../../actions/index.cjs");
21
- var _validation = require("../../validation.cjs");
20
+ var _index = require("../../actions/index.js");
21
+ var _validation = require("../../validation.js");
22
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
23
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
24
  function EmailVerificationForm({
@@ -17,8 +17,8 @@ import { toast } from "sonner";
17
17
  import {
18
18
  resendEmailVerificationCodeAction,
19
19
  verifyEmailAction
20
- } from "../../actions/index.mjs";
21
- import { verifyEmailSchema } from "../../validation.mjs";
20
+ } from "../../actions/index.js";
21
+ import { verifyEmailSchema } from "../../validation.js";
22
22
  export function EmailVerificationForm({ email = "" }) {
23
23
  const [generalError, setGeneralError] = useState("");
24
24
  const { t } = useTranslation();
@@ -7,7 +7,7 @@ module.exports = Page;
7
7
  var _server = require("@arch-cadre/core/server");
8
8
  var _navigation = require("next/navigation");
9
9
  var React = _interopRequireWildcard(require("react"));
10
- var _components = require("./components.cjs");
10
+ var _components = require("./components.js");
11
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
12
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
13
  async function Page() {
@@ -7,7 +7,7 @@ import * as React from "react";
7
7
  import {
8
8
  EmailVerificationForm,
9
9
  ResendEmailVerificationCodeForm
10
- } from "./components.mjs";
10
+ } from "./components.js";
11
11
  export default async function Page() {
12
12
  const { user } = await getCurrentSession();
13
13
  if (user === null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arch-cadre/auth",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Auth module for Kryo framework",
5
5
  "type": "module",
6
6
  "exports": {
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
+ "src",
21
22
  "locales",
22
23
  "manifest.json"
23
24
  ],
@@ -30,8 +31,8 @@
30
31
  "build": "unbuild"
31
32
  },
32
33
  "dependencies": {
33
- "@arch-cadre/modules": "^0.0.73",
34
- "@arch-cadre/ui": "^0.0.47",
34
+ "@arch-cadre/modules": "^0.0.79",
35
+ "@arch-cadre/ui": "^0.0.53",
35
36
  "@hookform/resolvers": "^3.10.0",
36
37
  "lucide-react": "^0.475.0",
37
38
  "react-hook-form": "^7.54.2",
@@ -39,7 +40,7 @@
39
40
  "zod": "^3.24.1"
40
41
  },
41
42
  "devDependencies": {
42
- "@arch-cadre/core": "^0.0.47",
43
+ "@arch-cadre/core": "^0.0.53",
43
44
  "@types/react": "^19",
44
45
  "next": "16.1.1",
45
46
  "react": "^19.0.0",
@@ -47,9 +48,9 @@
47
48
  "unbuild": "^3.6.1"
48
49
  },
49
50
  "peerDependencies": {
50
- "@arch-cadre/core": "^0.0.47",
51
- "@arch-cadre/intl": "^0.0.47",
52
- "@arch-cadre/ui": "^0.0.47",
51
+ "@arch-cadre/core": "^0.0.53",
52
+ "@arch-cadre/intl": "^0.0.53",
53
+ "@arch-cadre/ui": "^0.0.53",
53
54
  "next": ">=13.0.0",
54
55
  "react": "^19.0.0"
55
56
  },
@@ -0,0 +1,53 @@
1
+ "use server";
2
+
3
+ import type { LoginInput, RegisterInput } from "@arch-cadre/core";
4
+ import { signIn, signOut, signUp } from "@arch-cadre/core/server";
5
+ import { redirect } from "next/navigation";
6
+ import type { ActionResult } from "../types.js";
7
+
8
+ /**
9
+ * Modern Login Action delegating to Core Auth
10
+ */
11
+ export async function loginAction(data: LoginInput): Promise<ActionResult> {
12
+ const result = await signIn(data);
13
+ console.log("[LoginAction] SignIn result:", JSON.stringify(result, null, 2));
14
+
15
+ if (result.status === "ERROR") {
16
+ return { success: false, message: result.message };
17
+ }
18
+
19
+ // Handle challenges or forced redirects
20
+ if (result.redirect) {
21
+ return redirect(result.redirect);
22
+ }
23
+
24
+ // Success flow
25
+ if (result.status === "SUCCESS") {
26
+ return redirect("/");
27
+ }
28
+
29
+ return { success: false, message: "Invalid authentication state" };
30
+ }
31
+
32
+ /**
33
+ * Modern Signup Action delegating to Core Auth
34
+ */
35
+ export async function signupAction(data: RegisterInput): Promise<ActionResult> {
36
+ try {
37
+ await signUp(data);
38
+ return redirect("/verify-email");
39
+ } catch (error: any) {
40
+ return {
41
+ success: false,
42
+ message: error.message || "Failed to create account",
43
+ };
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Modern Logout Action delegating to Core Auth
49
+ */
50
+ export async function logoutAction(): Promise<ActionResult> {
51
+ await signOut();
52
+ return redirect("/signin");
53
+ }