@vilio/auth-module 0.0.3 → 0.0.5
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/actions/basic.d.ts +1 -0
- package/dist/actions/basic.d.ts.map +1 -0
- package/dist/actions/basic.js +45 -0
- package/dist/actions/basic.js.map +1 -0
- package/dist/actions/email.d.ts +1 -0
- package/dist/actions/email.d.ts.map +1 -0
- package/dist/actions/email.js +138 -0
- package/dist/actions/email.js.map +1 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +3 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +3 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{index.mjs → index.js} +10 -9
- package/dist/index.js.map +1 -0
- package/dist/routes.d.ts +1 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +51 -0
- package/dist/routes.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/forgot-password/components.d.ts +2 -2
- package/dist/ui/forgot-password/components.d.ts.map +1 -0
- package/dist/ui/forgot-password/components.js +42 -0
- package/dist/ui/forgot-password/components.js.map +1 -0
- package/dist/ui/forgot-password/page.d.ts +2 -2
- package/dist/ui/forgot-password/page.d.ts.map +1 -0
- package/dist/ui/forgot-password/page.js +6 -0
- package/dist/ui/forgot-password/page.js.map +1 -0
- package/dist/ui/layout.d.ts +2 -1
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +13 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/reset-password/components.d.ts +2 -2
- package/dist/ui/reset-password/components.d.ts.map +1 -0
- package/dist/ui/reset-password/components.js +43 -0
- package/dist/ui/reset-password/components.js.map +1 -0
- package/dist/ui/reset-password/page.d.ts +2 -2
- package/dist/ui/reset-password/page.d.ts.map +1 -0
- package/dist/ui/reset-password/page.js +20 -0
- package/dist/ui/reset-password/page.js.map +1 -0
- package/dist/ui/reset-password/verify-email/components.d.ts +2 -2
- package/dist/ui/reset-password/verify-email/components.d.ts.map +1 -0
- package/dist/ui/reset-password/verify-email/components.js +38 -0
- package/dist/ui/reset-password/verify-email/components.js.map +1 -0
- package/dist/ui/reset-password/verify-email/page.d.ts +2 -2
- package/dist/ui/reset-password/verify-email/page.d.ts.map +1 -0
- package/dist/ui/reset-password/verify-email/page.js +19 -0
- package/dist/ui/reset-password/verify-email/page.js.map +1 -0
- package/dist/ui/signin/components.d.ts +2 -1
- package/dist/ui/signin/components.d.ts.map +1 -0
- package/dist/ui/signin/components.js +49 -0
- package/dist/ui/signin/components.js.map +1 -0
- package/dist/ui/signin/page.d.ts +2 -2
- package/dist/ui/signin/page.d.ts.map +1 -0
- package/dist/ui/signin/page.js +21 -0
- package/dist/ui/signin/page.js.map +1 -0
- package/dist/ui/signup/components.d.ts +2 -1
- package/dist/ui/signup/components.d.ts.map +1 -0
- package/dist/ui/signup/components.js +49 -0
- package/dist/ui/signup/components.js.map +1 -0
- package/dist/ui/signup/page.d.ts +2 -2
- package/dist/ui/signup/page.d.ts.map +1 -0
- package/dist/ui/signup/page.js +15 -0
- package/dist/ui/signup/page.js.map +1 -0
- package/dist/ui/verify-email/components.d.ts +3 -2
- package/dist/ui/verify-email/components.d.ts.map +1 -0
- package/dist/ui/verify-email/components.js +55 -0
- package/dist/ui/verify-email/components.js.map +1 -0
- package/dist/ui/verify-email/page.d.ts +2 -2
- package/dist/ui/verify-email/page.d.ts.map +1 -0
- package/dist/ui/verify-email/page.js +18 -0
- package/dist/ui/verify-email/page.js.map +1 -0
- package/dist/validation.d.ts +1 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +42 -0
- package/dist/validation.js.map +1 -0
- package/locales/en/global.json +2 -1
- package/locales/pl/global.json +2 -1
- package/package.json +17 -28
- package/dist/actions/basic.cjs +0 -46
- package/dist/actions/basic.mjs +0 -32
- package/dist/actions/email.cjs +0 -209
- package/dist/actions/email.mjs +0 -186
- package/dist/actions/index.cjs +0 -27
- package/dist/actions/index.mjs +0 -2
- package/dist/index.cjs +0 -22
- package/dist/intl.d.ts +0 -9
- package/dist/routes.cjs +0 -46
- package/dist/routes.mjs +0 -48
- package/dist/types.cjs +0 -1
- package/dist/types.mjs +0 -0
- package/dist/ui/forgot-password/components.cjs +0 -91
- package/dist/ui/forgot-password/components.mjs +0 -63
- package/dist/ui/forgot-password/page.cjs +0 -13
- package/dist/ui/forgot-password/page.mjs +0 -5
- package/dist/ui/layout.cjs +0 -39
- package/dist/ui/layout.mjs +0 -18
- package/dist/ui/reset-password/components.cjs +0 -109
- package/dist/ui/reset-password/components.mjs +0 -84
- package/dist/ui/reset-password/page.cjs +0 -29
- package/dist/ui/reset-password/page.mjs +0 -21
- package/dist/ui/reset-password/verify-email/components.cjs +0 -106
- package/dist/ui/reset-password/verify-email/components.mjs +0 -62
- package/dist/ui/reset-password/verify-email/page.cjs +0 -31
- package/dist/ui/reset-password/verify-email/page.mjs +0 -21
- package/dist/ui/signin/components.cjs +0 -172
- package/dist/ui/signin/components.mjs +0 -134
- package/dist/ui/signin/page.cjs +0 -41
- package/dist/ui/signin/page.mjs +0 -39
- package/dist/ui/signup/components.cjs +0 -193
- package/dist/ui/signup/components.mjs +0 -150
- package/dist/ui/signup/page.cjs +0 -37
- package/dist/ui/signup/page.mjs +0 -35
- package/dist/ui/verify-email/components.cjs +0 -129
- package/dist/ui/verify-email/components.mjs +0 -76
- package/dist/ui/verify-email/page.cjs +0 -29
- package/dist/ui/verify-email/page.mjs +0 -21
- package/dist/validation.cjs +0 -43
- package/dist/validation.mjs +0 -37
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getCurrentSession,
|
|
3
|
-
getUserEmailVerificationRequestFromRequest
|
|
4
|
-
} from "@vilio/core/server";
|
|
5
|
-
import { redirect } from "next/navigation";
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import {
|
|
8
|
-
EmailVerificationForm,
|
|
9
|
-
ResendEmailVerificationCodeForm
|
|
10
|
-
} from "./components.mjs";
|
|
11
|
-
export default async function Page() {
|
|
12
|
-
const { user } = await getCurrentSession();
|
|
13
|
-
if (user === null) {
|
|
14
|
-
return redirect("/signin");
|
|
15
|
-
}
|
|
16
|
-
const verificationRequest = await getUserEmailVerificationRequestFromRequest();
|
|
17
|
-
if (verificationRequest === null && user.emailVerifiedAt) {
|
|
18
|
-
return redirect("/?verified");
|
|
19
|
-
}
|
|
20
|
-
return /* @__PURE__ */ React.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React.createElement(EmailVerificationForm, { email: verificationRequest?.email ?? user.email }), /* @__PURE__ */ React.createElement(ResendEmailVerificationCodeForm, null));
|
|
21
|
-
}
|
package/dist/validation.cjs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.verifyEmailSchema = exports.totpVerifySchema = exports.totpSetupSchema = exports.resetPasswordSchema = exports.registerSchema = exports.recoveryCodeVerifySchema = exports.passkeysSetupSchema = exports.loginSchema = exports.forgotPasswordSchema = void 0;
|
|
7
|
-
var _zod = require("zod");
|
|
8
|
-
const loginSchema = exports.loginSchema = _zod.z.object({
|
|
9
|
-
email: _zod.z.string().email("Invalid email address"),
|
|
10
|
-
password: _zod.z.string().min(8),
|
|
11
|
-
remember: _zod.z.boolean().optional()
|
|
12
|
-
});
|
|
13
|
-
const registerSchema = exports.registerSchema = _zod.z.object({
|
|
14
|
-
username: _zod.z.string().min(2, "Name must be at least 2 characters"),
|
|
15
|
-
email: _zod.z.string().email("Invalid email address"),
|
|
16
|
-
password: _zod.z.string().min(8, "Password must be at least 8 characters"),
|
|
17
|
-
terms: _zod.z.boolean().refine(val => val === true, "You must accept the terms")
|
|
18
|
-
});
|
|
19
|
-
const forgotPasswordSchema = exports.forgotPasswordSchema = _zod.z.object({
|
|
20
|
-
email: _zod.z.string().email("Invalid email address")
|
|
21
|
-
});
|
|
22
|
-
const resetPasswordSchema = exports.resetPasswordSchema = _zod.z.object({
|
|
23
|
-
password: _zod.z.string().min(8, "Password must be at least 8 characters"),
|
|
24
|
-
confirm: _zod.z.string()
|
|
25
|
-
}).refine(data => data.password === data.confirm, {
|
|
26
|
-
message: "Passwords do not match",
|
|
27
|
-
path: ["confirm"]
|
|
28
|
-
});
|
|
29
|
-
const verifyEmailSchema = exports.verifyEmailSchema = _zod.z.object({
|
|
30
|
-
code: _zod.z.string().min(6).max(6)
|
|
31
|
-
});
|
|
32
|
-
const totpSetupSchema = exports.totpSetupSchema = _zod.z.object({
|
|
33
|
-
code: _zod.z.string().regex(/^\d{6}$/, "Code must be 6 digits")
|
|
34
|
-
});
|
|
35
|
-
const totpVerifySchema = exports.totpVerifySchema = _zod.z.object({
|
|
36
|
-
code: _zod.z.string().regex(/^\d{6}$/, "Code must be 6 digits")
|
|
37
|
-
});
|
|
38
|
-
const passkeysSetupSchema = exports.passkeysSetupSchema = _zod.z.object({
|
|
39
|
-
name: _zod.z.string().min(1, "Passkey name is required")
|
|
40
|
-
});
|
|
41
|
-
const recoveryCodeVerifySchema = exports.recoveryCodeVerifySchema = _zod.z.object({
|
|
42
|
-
code: _zod.z.string().min(16, "Recovery code is required").max(16)
|
|
43
|
-
});
|
package/dist/validation.mjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const loginSchema = z.object({
|
|
3
|
-
email: z.string().email("Invalid email address"),
|
|
4
|
-
password: z.string().min(8),
|
|
5
|
-
remember: z.boolean().optional()
|
|
6
|
-
});
|
|
7
|
-
export const registerSchema = z.object({
|
|
8
|
-
username: z.string().min(2, "Name must be at least 2 characters"),
|
|
9
|
-
email: z.string().email("Invalid email address"),
|
|
10
|
-
password: z.string().min(8, "Password must be at least 8 characters"),
|
|
11
|
-
terms: z.boolean().refine((val) => val === true, "You must accept the terms")
|
|
12
|
-
});
|
|
13
|
-
export const forgotPasswordSchema = z.object({
|
|
14
|
-
email: z.string().email("Invalid email address")
|
|
15
|
-
});
|
|
16
|
-
export const resetPasswordSchema = z.object({
|
|
17
|
-
password: z.string().min(8, "Password must be at least 8 characters"),
|
|
18
|
-
confirm: z.string()
|
|
19
|
-
}).refine((data) => data.password === data.confirm, {
|
|
20
|
-
message: "Passwords do not match",
|
|
21
|
-
path: ["confirm"]
|
|
22
|
-
});
|
|
23
|
-
export const verifyEmailSchema = z.object({
|
|
24
|
-
code: z.string().min(6).max(6)
|
|
25
|
-
});
|
|
26
|
-
export const totpSetupSchema = z.object({
|
|
27
|
-
code: z.string().regex(/^\d{6}$/, "Code must be 6 digits")
|
|
28
|
-
});
|
|
29
|
-
export const totpVerifySchema = z.object({
|
|
30
|
-
code: z.string().regex(/^\d{6}$/, "Code must be 6 digits")
|
|
31
|
-
});
|
|
32
|
-
export const passkeysSetupSchema = z.object({
|
|
33
|
-
name: z.string().min(1, "Passkey name is required")
|
|
34
|
-
});
|
|
35
|
-
export const recoveryCodeVerifySchema = z.object({
|
|
36
|
-
code: z.string().min(16, "Recovery code is required").max(16)
|
|
37
|
-
});
|