diff --git a/.env b/.env
deleted file mode 100644
index f52c411..0000000
--- a/.env
+++ /dev/null
@@ -1,20 +0,0 @@
-DATABASE_URL=mongodb+srv://freshbitemehedi:freshbitemehedi2810@project1.lispgny.mongodb.net/Skilld
-
-UPLOADTHING_SECRET=sk_live_938397c2e99554ab0bc541ba01114334d2ed523a0dbb9988870bcfc05d6ad9df
-UPLOADTHING_APP_ID=h07pj3xjyv
-
-NEXTAUTH_URL=http://localhost:3000
-NEXTAUTH_SECRET=2aqrEwXp57xY5dA6WN5akp3ceFDVg64Qu0Ufm/Dew8g=
-
-# Go to github and setup the oauth configuration
-# https://next-auth.js.org/providers/github#configuration
-# https://github.com/settings/developers
-
-GITHUB_ID=674c632636000fe44d40
-GITHUB_SECRET=0ec0b70e902ae00021514e21427108275ef4244b
-
-
-NEXT_PUBLIC_SUPABASE_URL=https://ckngsmtjumbnwksjutdo.supabase.co
-NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNrbmdzbXRqdW1ibndrc2p1dGRvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTAzNDIwNjMsImV4cCI6MjAyNTkxODA2M30.ZkykkQeBh8-Ej8_2KMdFPNelEF6jzAgb1Nqd64vwAvs
-
-NEXT_PUBLIC_SITE_URL=http://localhost:3000
\ No newline at end of file
diff --git a/src/app/(auth)/(signin)/page.tsx b/src/app/(auth)/(signup)/page.tsx
similarity index 50%
rename from src/app/(auth)/(signin)/page.tsx
rename to src/app/(auth)/(signup)/page.tsx
index 454a06f..90a1ce9 100644
--- a/src/app/(auth)/(signin)/page.tsx
+++ b/src/app/(auth)/(signup)/page.tsx
@@ -1,29 +1,49 @@
import { Metadata } from "next";
import Link from "next/link";
-import UserAuthForm from "@/components/forms/user-auth-form";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
+import Image from "next/image";
+import SignUpForm from "@/components/forms/signup-form";
export const metadata: Metadata = {
- title: "Sign In | Skilld",
- description: "Sign In to start your journey with Skilld.",
+ title: "Sign Up | Skilld",
+ description: "Sign Up to start your journey with Skilld.",
};
export default function AuthenticationPage() {
return (
- Login
+ Sign In
-
+
+
+
+
+ {/*
Skilld
-
+
*/}
@@ -57,28 +77,36 @@ export default function AuthenticationPage() {
Create an account
-
- Enter your email below to create your account
+ {/*
+ Enter your email and password below to create your account
+
*/}
+
+
+
+
+ Already have an account?{" "}
+
+ Sign In
+
+
+
+ By clicking continue, you agree to our{" "}
+
+ Terms of Service
+ {" "}
+ and{" "}
+
+ Privacy Policy
+
+ .
-
-
- By clicking continue, you agree to our{" "}
-
- Terms of Service
- {" "}
- and{" "}
-
- Privacy Policy
-
- .
-
diff --git a/src/app/(auth)/signin/page.tsx b/src/app/(auth)/signin/page.tsx
new file mode 100644
index 0000000..78f8108
--- /dev/null
+++ b/src/app/(auth)/signin/page.tsx
@@ -0,0 +1,114 @@
+import { Metadata } from "next";
+import Link from "next/link";
+import { buttonVariants } from "@/components/ui/button";
+import { cn } from "@/lib/utils";
+import Image from "next/image";
+import SignInForm from "@/components/forms/signin-form";
+
+export const metadata: Metadata = {
+ title: "Sign In | Skilld",
+ description: "Sign In to restart your journey with Skilld.",
+};
+
+export default function AuthenticationPage() {
+ return (
+
+
+ Sign Up
+
+
+
+
+
+
+
+ {/*
+
+ Skilld
+
*/}
+
+
+
+ “Empower your coding journey at Skilld. Access tutorials,
+ challenges, and expert-led courses to master programming languages
+ and tools. Join a supportive community for discussions and code
+ reviews. Elevate your skills and stay ahead in the tech world with
+ us!.”
+
+ {/* */}
+
+
+
+
+
+
+
+ Sign In To Your Account
+
+ {/*
+ Enter your email and password below to create your account
+
*/}
+
+
+
+
+ Don't have an account?{" "}
+
+ Sign Up
+
+
+ {/*
+ By clicking continue, you agree to our{" "}
+
+ Terms of Service
+ {" "}
+ and{" "}
+
+ Privacy Policy
+
+ .
+
*/}
+
+
+
+
+ );
+}
diff --git a/src/app/(dashboard)/dashboard/(quiz)/layout.tsx b/src/app/(dashboard)/dashboard/(quiz)/layout.tsx
index e255bdb..200d0f7 100644
--- a/src/app/(dashboard)/dashboard/(quiz)/layout.tsx
+++ b/src/app/(dashboard)/dashboard/(quiz)/layout.tsx
@@ -1,7 +1,9 @@
import Header from "@/components/layout/header";
import Sidebar from "@/components/layout/sidebar";
import StoreProvider from "@/lib/store-provider";
+import { createClient } from "@/utils/supabase/server";
import type { Metadata } from "next";
+import { redirect } from "next/navigation";
export const metadata: Metadata = {
title: "Dashboard | Skilld",
@@ -9,11 +11,22 @@ export const metadata: Metadata = {
"Empower your coding journey at Skilld. Access tutorials, challenges, and expert-led courses to master programming languages and tools. Join a supportive community for discussions and code reviews. Elevate your skills and stay ahead in the tech world with us!",
};
-export default function DashboardLayout({
+export default async function DashboardLayout({
children,
}: {
children: React.ReactNode;
}) {
+
+ const supabase = createClient();
+
+ const {
+ data: { user },
+ } = await supabase.auth.getUser();
+
+ if (!user) {
+ return redirect("/signin");
+ }
+
return (
<>
diff --git a/src/app/(dashboard)/dashboard/(task)/layout.tsx b/src/app/(dashboard)/dashboard/(task)/layout.tsx
index 0ad1363..9b94443 100644
--- a/src/app/(dashboard)/dashboard/(task)/layout.tsx
+++ b/src/app/(dashboard)/dashboard/(task)/layout.tsx
@@ -1,13 +1,25 @@
import { Metadata } from "next";
import React from "react";
import Header from "@/components/task/header";
+import { createClient } from "@/utils/supabase/server";
+import { redirect } from "next/navigation";
export const metadata: Metadata = {
title: "Task | Skilld",
description: "Skilld",
};
-const Layout = ({ children }: { children: React.ReactNode }) => {
+const Layout = async ({ children }: { children: React.ReactNode }) => {
+ const supabase = createClient();
+
+ const {
+ data: { user },
+ } = await supabase.auth.getUser();
+
+ if (!user) {
+ return redirect("/signin");
+ }
+
return (