Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ let lock = false;
export default function Login() {
const app = HAS_STACK_KEYS ? useStackApp() : null;
const { setAuth, setModelType, setLocalProxyValue } = useAuthStore();
const isLocalMode = import.meta.env.VITE_USE_LOCAL_PROXY === "true";
const navigate = useNavigate();
const location = useLocation();
const [hidePassword, setHidePassword] = useState(true);
Expand Down Expand Up @@ -154,6 +155,14 @@ export default function Login() {
await app.signInWithOAuth(type);
};

const handleSignupClick = () => {
if (isLocalMode) {
navigate("/signup");
} else {
window.open("https://www.eigent.ai/signup", "_blank", "noopener,noreferrer");
}
};

const handleGetToken = async (code: string) => {
const code_verifier = localStorage.getItem("stack-oauth-outer-");
const formData = new URLSearchParams();
Expand Down Expand Up @@ -294,7 +303,7 @@ export default function Login() {
<Button
variant="ghost"
size="sm"
onClick={() => navigate("/signup")}
onClick={handleSignupClick}
>
{t("layout.sign-up")}
</Button>
Expand Down
16 changes: 16 additions & 0 deletions src/pages/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let lock = false;
export default function SignUp() {
const app = HAS_STACK_KEYS ? useStackApp() : null;
const { setAuth, initState } = useAuthStore();
const isLocalMode = import.meta.env.VITE_USE_LOCAL_PROXY === "true";
const navigate = useNavigate();
const location = useLocation();
const [hidePassword, setHidePassword] = useState(true);
Expand Down Expand Up @@ -84,6 +85,10 @@ export default function SignUp() {
};

const handleRegister = async () => {
if (!isLocalMode) {
window.open("https://www.eigent.ai/signup", "_blank", "noopener,noreferrer");
return;
}
if (!validateForm()) {
return;
}
Expand Down Expand Up @@ -150,6 +155,10 @@ export default function SignUp() {
};

const handleReloadBtn = async (type: string) => {
if (!isLocalMode) {
window.open("https://www.eigent.ai/signup", "_blank", "noopener,noreferrer");
return;
}
localStorage.setItem("invite_code", formData.invite_code);
console.log("handleReloadBtn1", type);
const cookies = document.cookie.split("; ");
Expand Down Expand Up @@ -229,6 +238,13 @@ export default function SignUp() {
};
}, []);

useEffect(() => {
if (!isLocalMode) {
window.open("https://www.eigent.ai/signup", "_blank", "noopener,noreferrer");
navigate("/login");
}
}, [isLocalMode, navigate]);

return (
<div className={`p-2 flex items-center justify-center gap-2 h-full`}>
<div className="flex items-center justify-center h-[calc(800px-16px)] rounded-3xl bg-white-100%">
Expand Down