diff --git a/src/auth/LoginScreen.tsx b/src/auth/LoginScreen.tsx new file mode 100644 index 000000000..2e80bc52e --- /dev/null +++ b/src/auth/LoginScreen.tsx @@ -0,0 +1,98 @@ +"use client"; + +import Button from "@components/Button"; +import Image from "next/image"; +import * as React from "react"; +import { ArrowRight } from "lucide-react"; +import NetBirdLogoFull from "@/assets/netbird-full.svg"; + +type Props = { + onLogin: () => void; +}; + +export const LoginScreen = ({ onLogin }: Props) => { + return ( +
+
+
+ {"NetBird +
+ +
+

+ Welcome back +

+

+ Sign in to access your NetBird network. +

+ + + +

+ Don't have an account yet?{" "} + + Get started + +

+
+
+ +
+
+
+ Connected peers + + Active + Idle + +
+
+ {[90, 76, 64, 48, 33, 22].map((w, i) => ( +
+
+
+ ))} +
+
+ +

+ Secure networking, zero config +

+

+ Connect your devices into a secure private network in minutes. +

+
+
+ ); +}; diff --git a/src/auth/SecureProvider.tsx b/src/auth/SecureProvider.tsx index 68b2c2461..0001b1aaf 100644 --- a/src/auth/SecureProvider.tsx +++ b/src/auth/SecureProvider.tsx @@ -2,6 +2,7 @@ import { OidcSecure, useOidc } from "@axa-fr/react-oidc"; import { usePathname } from "next/navigation"; import * as React from "react"; import { useEffect } from "react"; +import { LoginScreen } from "@/auth/LoginScreen"; const QUERY_PARAMS_KEY = "netbird-query-params"; @@ -72,19 +73,9 @@ export const SecureProvider = ({ children }: Props) => { } }, [isAuthenticated, currentPath]); - useEffect(() => { - let timeout: NodeJS.Timeout | undefined = undefined; - if (!isAuthenticated) { - timeout = setTimeout(async () => { - if (!isAuthenticated) { - await login(currentPath); - } - }, 1500); - } - return () => { - clearTimeout(timeout); - }; - }, [currentPath, isAuthenticated, login]); + if (!isAuthenticated) { + return login(currentPath)} />; + } return ( <>