signin update

This commit is contained in:
allinix 2025-02-18 19:02:38 +05:30
parent 349c94c7e5
commit 6f692a54a8

View File

@ -1,4 +1,4 @@
import React from "react";
import React, { useEffect } from "react";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/navigation";
@ -8,12 +8,14 @@ const signin: React.FC = () => {
const router = useRouter();
const { login, authenticated, ready } = usePrivy();
const handleAccess = () => {
if (authenticated) {
useEffect(() => {
if (ready && authenticated) {
router.push("/chat");
} else {
login();
}
}, [authenticated, ready, router]);
const handleAccess = () => {
login();
};
return (
@ -67,4 +69,4 @@ const signin: React.FC = () => {
);
};
export default signin;
export default signin;