diff --git a/src/front/Components/Layouts/Protect/classes.module.scss b/src/front/Components/Layouts/Protect/classes.module.scss deleted file mode 100644 index 4291a2ac..00000000 --- a/src/front/Components/Layouts/Protect/classes.module.scss +++ /dev/null @@ -1,29 +0,0 @@ -@import "@Themes/constants.scss"; - -.root { - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; - height: 100%; - max-width: 530px; - margin: auto; - - .title { - margin: 32px 0; - text-align: center; - - @media (max-width: $screen-s) { - font-family: 48px; - } - } - - .forget-password { - margin-top: 32px; - margin-bottom: 8px; - } - - .form { - display: flex; - } -} diff --git a/src/front/Components/Layouts/Protect/index.tsx b/src/front/Components/Layouts/Protect/index.tsx deleted file mode 100644 index 695910ad..00000000 --- a/src/front/Components/Layouts/Protect/index.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import Module from "@Front/Config/Module"; -import { useRouter } from "next/router"; -import { useState } from "react"; -import Image from "next/image"; -import classes from "./classes.module.scss"; -import LandingImage from "./landing-connect.jpeg"; -import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage"; -import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography"; -import CoffreIcon from "@Assets/Icons/coffre.svg"; -import TextField from "@Front/Components/DesignSystem/Form/TextField"; -import Button from "@Front/Components/DesignSystem/Button"; - -export default function Protect() { - const [password, setPassword] = useState(""); - const router = useRouter(); - const setPasswordFromInput = (event: React.ChangeEvent) => { - setPassword(event.target.value); - }; - - const submitAuth = (e: React.FormEvent) => { - e.preventDefault(); - - if (password === "team-fullstack") { - console.log("ok"); - setCookie("protect_staging", Date.now().toString()); - router.push(Module.getInstance().get().modules.pages.Login.props.path); - } else { - console.log("pas ok"); - } - }; - - const setCookie = (name: string, value: string) => { - if (!name || !value) throw new Error("Cookie name or value is empty"); - const date = new Date(); - - // Set it expire in 7 days - date.setTime(date.getTime() + 7 * 24 * 60 * 60 * 1000); - - // Set it - document.cookie = name + "=" + value + "; expires=" + date.toUTCString() + "; path=/"; - }; - - return ( - -
- coffre - -
Le site est verrouillé
-
-
- - - -
-
- ); -} diff --git a/src/front/Components/Layouts/Protect/landing-connect.jpeg b/src/front/Components/Layouts/Protect/landing-connect.jpeg deleted file mode 100644 index 789e0ef3..00000000 Binary files a/src/front/Components/Layouts/Protect/landing-connect.jpeg and /dev/null differ diff --git a/src/middleware.ts b/src/middleware.ts index 02594795..588e132a 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -4,9 +4,6 @@ import { NextResponse } from "next/server"; import type { NextRequest } from "next/server"; export async function middleware(request: NextRequest) { - const cookieStaging = request.cookies.get("protect_staging"); - if (!cookieStaging) return NextResponse.redirect(new URL("/protect", request.url)); - // Get the JWT from the cookies const cookies = request.cookies.get("leCoffreAccessToken"); if (!cookies) return NextResponse.redirect(new URL("/login", request.url)); diff --git a/src/pages/protect.tsx b/src/pages/protect.tsx deleted file mode 100644 index d554b993..00000000 --- a/src/pages/protect.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import Protect from "@Front/Components/Layouts/Protect"; - -export default function Route() { - return ; -}