From 35457401085de3923b5d76d00257d88bba1f536f Mon Sep 17 00:00:00 2001 From: JuliusMoehring <44407680+JuliusMoehring@users.noreply.github.com> Date: Tue, 7 Nov 2023 18:32:31 +0100 Subject: [PATCH] Add basic login screen | add logout button --- app/components/sidebar.tsx | 37 +++++++++++++++++++++++++++---------- app/constant.ts | 2 +- app/icons/signout.svg | 1 + app/login/login.module.scss | 25 +++++++++++++++++++++++++ app/login/page.tsx | 34 +++++++++++++++++++++++++++++++--- 5 files changed, 85 insertions(+), 14 deletions(-) create mode 100644 app/icons/signout.svg create mode 100644 app/login/login.module.scss diff --git a/app/components/sidebar.tsx b/app/components/sidebar.tsx index 56a9fe78b..502118183 100644 --- a/app/components/sidebar.tsx +++ b/app/components/sidebar.tsx @@ -1,16 +1,16 @@ -import { useEffect, useRef, useCallback } from "react"; +import { useEffect, useRef } from "react"; import styles from "./home.module.scss"; -import { IconButton } from "./button"; -import SettingsIcon from "../icons/settings.svg"; -import GithubIcon from "../icons/github.svg"; -import ChatGptIcon from "../icons/chatgpt.svg"; import AddIcon from "../icons/add.svg"; import CloseIcon from "../icons/close.svg"; +import DragIcon from "../icons/drag.svg"; +import GithubIcon from "../icons/github.svg"; import MaskIcon from "../icons/mask.svg"; import PluginIcon from "../icons/plugin.svg"; -import DragIcon from "../icons/drag.svg"; +import SettingsIcon from "../icons/settings.svg"; +import SignoutIcon from "../icons/signout.svg"; +import { IconButton } from "./button"; import Locale from "../locales"; @@ -25,9 +25,10 @@ import { REPO_URL, } from "../constant"; +import { signOut } from "next-auth/react"; +import dynamic from "next/dynamic"; import { Link, useNavigate } from "react-router-dom"; import { useMobileScreen } from "../utils"; -import dynamic from "next/dynamic"; import { showConfirm, showToast } from "./ui-lib"; const ChatList = dynamic(async () => (await import("./chat-list")).ChatList, { @@ -148,11 +149,17 @@ export function SideBar(props: { className?: string }) { AdExGPT - via API
+ Before you can start using AdEx GPT you have to sign in using your AdEx + account. After a successful sign in you will be redirected to the chat. +
+ + {session.status === "authenticated" ? ( + +