mirror of
https://github.com/trushildhokiya/allininx-2.git
synced 2025-03-15 11:38:40 +00:00
signin update
This commit is contained in:
parent
349c94c7e5
commit
6f692a54a8
@ -1,4 +1,4 @@
|
|||||||
import React from "react";
|
import React, { useEffect } from "react";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
@ -8,12 +8,14 @@ const signin: React.FC = () => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { login, authenticated, ready } = usePrivy();
|
const { login, authenticated, ready } = usePrivy();
|
||||||
|
|
||||||
const handleAccess = () => {
|
useEffect(() => {
|
||||||
if (authenticated) {
|
if (ready && authenticated) {
|
||||||
router.push("/chat");
|
router.push("/chat");
|
||||||
} else {
|
|
||||||
login();
|
|
||||||
}
|
}
|
||||||
|
}, [authenticated, ready, router]);
|
||||||
|
|
||||||
|
const handleAccess = () => {
|
||||||
|
login();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user