11"use client" ;
22
33import { getMessage } from "@/lib/message" ;
4- import { getXnodeAddress } from "@/lib/xnode-address" ;
4+ import { toXnodeAddress } from "@/lib/xnode-address" ;
55import sdk from "@farcaster/miniapp-sdk" ;
66import { useRouter , useSearchParams } from "next/navigation" ;
77import { useEffect , useState } from "react" ;
@@ -15,7 +15,7 @@ export function Login({ deniedForUser }: { deniedForUser?: string }) {
1515 } , [ searchParams ] ) ;
1616 const { replace } = useRouter ( ) ;
1717
18- const { isConnected } = useAccount ( ) ;
18+ const { address } = useAccount ( ) ;
1919 const { signMessageAsync, isPending, error : signError } = useSignMessage ( ) ;
2020
2121 const [ loginError , setLoginError ] = useState < string > ( "" ) ;
@@ -45,7 +45,7 @@ export function Login({ deniedForUser }: { deniedForUser?: string }) {
4545 : signError . message }
4646 </ span >
4747 ) }
48- { isConnected &&
48+ { address &&
4949 ( isPending ? (
5050 < div className = "flex gap-2" >
5151 < svg
@@ -94,11 +94,7 @@ export function Login({ deniedForUser }: { deniedForUser?: string }) {
9494 "Content-Type" : "application/json" ,
9595 } ,
9696 body : JSON . stringify ( {
97- user : await getXnodeAddress ( {
98- domain,
99- signature,
100- timestamp : timestamp . toString ( ) ,
101- } ) ,
97+ user : toXnodeAddress ( { address } ) ,
10298 signature,
10399 timestamp : timestamp . toString ( ) ,
104100 } ) ,
0 commit comments