@marvs13/marvinel-nextjs-supabase-starting-kit 1.0.2
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/cli.js +95 -0
- package/package.json +27 -0
- package/template/.env.local_example +5 -0
- package/template/src/app/(auth)/change-password/page.tsx +11 -0
- package/template/src/app/(auth)/login/page.tsx +11 -0
- package/template/src/app/(auth)/request-reset-password/page.tsx +11 -0
- package/template/src/app/(auth)/reset-password/page.tsx +11 -0
- package/template/src/app/(auth)/signup/page.tsx +11 -0
- package/template/src/app/(auth)/signup-success/page.tsx +34 -0
- package/template/src/app/favicon.ico +0 -0
- package/template/src/app/globals.css +124 -0
- package/template/src/app/home/page.tsx +35 -0
- package/template/src/app/layout.tsx +35 -0
- package/template/src/app/not-found.tsx +9 -0
- package/template/src/app/page.tsx +11 -0
- package/template/src/components/forms/change-password.tsx +197 -0
- package/template/src/components/forms/login-form.tsx +188 -0
- package/template/src/components/forms/request-reset-password-form.tsx +137 -0
- package/template/src/components/forms/reset-password-form.tsx +199 -0
- package/template/src/components/forms/signup-form.tsx +231 -0
- package/template/src/components/hero.tsx +38 -0
- package/template/src/components/logout-button.tsx +52 -0
- package/template/src/components/page-not-found.tsx +32 -0
- package/template/src/components/ui/button.tsx +65 -0
- package/template/src/components/ui/card.tsx +92 -0
- package/template/src/components/ui/field.tsx +249 -0
- package/template/src/components/ui/input-group.tsx +171 -0
- package/template/src/components/ui/input.tsx +21 -0
- package/template/src/components/ui/label.tsx +25 -0
- package/template/src/components/ui/separator.tsx +29 -0
- package/template/src/components/ui/spinner.tsx +16 -0
- package/template/src/components/ui/textarea.tsx +18 -0
- package/template/src/hooks/use-auth-form.ts +47 -0
- package/template/src/lib/supabase/client.ts +8 -0
- package/template/src/lib/supabase/proxy.ts +55 -0
- package/template/src/lib/supabase/server.ts +34 -0
- package/template/src/lib/utils.ts +6 -0
- package/template/src/proxy.ts +21 -0
- package/template/src/schema/form-schema.ts +55 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { NextRequest } from "next/server";
|
|
2
|
+
|
|
3
|
+
import { updateSession } from "./lib/supabase/proxy";
|
|
4
|
+
|
|
5
|
+
export async function proxy(request: NextRequest) {
|
|
6
|
+
return await updateSession(request);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const config = {
|
|
10
|
+
matcher: [
|
|
11
|
+
/*
|
|
12
|
+
* Match all request paths except:
|
|
13
|
+
* - _next/static (static files)
|
|
14
|
+
* - _next/image (image optimization files)
|
|
15
|
+
* - favicon.ico (favicon file)
|
|
16
|
+
* - images - .svg, .png, .jpg, .jpeg, .gif, .webp
|
|
17
|
+
* Feel free to modify this pattern to include more paths.
|
|
18
|
+
*/
|
|
19
|
+
"/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
|
|
20
|
+
],
|
|
21
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const SignUpFormSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
email: z
|
|
6
|
+
.email("Please enter a valid email.")
|
|
7
|
+
.min(1, "Please enter your email."),
|
|
8
|
+
username: z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1, "Please enter a user name.")
|
|
11
|
+
.max(25, "Username must be at most 25 characters."),
|
|
12
|
+
password: z
|
|
13
|
+
.string()
|
|
14
|
+
.min(8, "Password must be at least 8 characters")
|
|
15
|
+
.regex(/[A-Z]/, "Password must contain at least one uppercase letter!")
|
|
16
|
+
.regex(/[0-9]/, "Password must contain at least one number!")
|
|
17
|
+
.regex(
|
|
18
|
+
/[^a-zA-Z0-9]/,
|
|
19
|
+
"Password must contain at least one special character!"
|
|
20
|
+
),
|
|
21
|
+
confirmPassword: z.string(),
|
|
22
|
+
})
|
|
23
|
+
.refine((data) => data.password === data.confirmPassword, {
|
|
24
|
+
error: "Your password don't match!",
|
|
25
|
+
path: ["confirmPassword"],
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const LogInFormSchema = z.object({
|
|
29
|
+
email: z
|
|
30
|
+
.email("Please enter a valid email.")
|
|
31
|
+
.min(1, "Please enter your email."),
|
|
32
|
+
password: z.string().min(1, "Please enter your password."),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const ReqResetPasswordSchema = z.object({
|
|
36
|
+
email: z.email("Enter your valid email.").min(1, "Please enter your email."),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const UpdatePasswordSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
password: z
|
|
42
|
+
.string()
|
|
43
|
+
.min(8, "Password must be at least 8 characters")
|
|
44
|
+
.regex(/[A-Z]/, "Password must contain at least one uppercase letter!")
|
|
45
|
+
.regex(/[0-9]/, "Password must contain at least one number!")
|
|
46
|
+
.regex(
|
|
47
|
+
/[^a-zA-Z0-9]/,
|
|
48
|
+
"Password must contain at least one special character!"
|
|
49
|
+
),
|
|
50
|
+
confirmPassword: z.string(),
|
|
51
|
+
})
|
|
52
|
+
.refine((data) => data.password === data.confirmPassword, {
|
|
53
|
+
error: "Your password don't match!",
|
|
54
|
+
path: ["confirmPassword"],
|
|
55
|
+
});
|