import styles from "./auth.module.scss"; import { IconButton } from "./button"; import { useNavigate } from "react-router-dom"; import { Path } from "../constant"; import { useAccessStore } from "../store"; import Locale from "../locales"; import BotIcon from "../icons/bot.svg"; import { useEffect } from "react"; import { getClientConfig } from "../config/client"; export function AuthPage() { const navigate = useNavigate(); const accessStore = useAccessStore(); const goHome = () => navigate(Path.Home); const goChat = () => navigate(Path.Chat); const resetAccessCode = () => { accessStore.update((access) => { access.openaiApiKey = ""; access.accessCode = ""; }); }; // Reset access code to empty string useEffect(() => { const clientConfig = getClientConfig(); if (clientConfig?.isApp) { // Force to set custom endpoint to true if it's app navigate(Path.Settings); accessStore.update((state) => { state.useCustomConfig = true; }); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return (