rc
This commit is contained in:
@@ -40,7 +40,8 @@ export default function DashboardPage() {
|
|||||||
}
|
}
|
||||||
if(ready){
|
if(ready){
|
||||||
if(username == "-1"){
|
if(username == "-1"){
|
||||||
router.push("/logincomplete");
|
console.log(user?.id);
|
||||||
|
router.push("/logincomplete");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,24 @@
|
|||||||
import { usePrivy } from "@privy-io/react-auth";
|
import { usePrivy } from "@privy-io/react-auth";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { SetStateAction, useState } from "react";
|
import { SetStateAction, useEffect, useState } from "react";
|
||||||
|
|
||||||
export default function LoginComplete() {
|
export default function LoginComplete() {
|
||||||
const [username, setUsername] = useState("");
|
const [username, setUsername] = useState("");
|
||||||
const [error, setError] = useState("");
|
const [error, setError] = useState("");
|
||||||
const {ready, user} = usePrivy();
|
const {ready, user,authenticated} = usePrivy();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const handleUsernameChange = (e: { target: { value: SetStateAction<string>; }; }) => {
|
const handleUsernameChange = (e: { target: { value: SetStateAction<string>; }; }) => {
|
||||||
setUsername(e.target.value);
|
setUsername(e.target.value);
|
||||||
setError("");
|
setError("");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if (ready && !authenticated) {
|
||||||
|
router.push("/");
|
||||||
|
}
|
||||||
|
},[ready, user])
|
||||||
|
|
||||||
const handleClaim = async () => {
|
const handleClaim = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
|
|||||||
Reference in New Issue
Block a user