Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useSignIn hook's qrCodeUri is always undefined #156

Open
tinaszheng opened this issue Apr 10, 2024 · 1 comment
Open

useSignIn hook's qrCodeUri is always undefined #156

tinaszheng opened this issue Apr 10, 2024 · 1 comment
Labels

Comments

@tinaszheng
Copy link

tinaszheng commented Apr 10, 2024

What is the bug?
I'm using useSignIn to create a custom sign-in button. However, I'm seeing that the qrCodeUri returned by the hook is always undefined. I think I'm following the example here quite closely. Am I misunderstanding its usage?

How can it be reproduced? (optional)
I am on version "@farcaster/auth-kit": "^0.1.4",
This is a tiny snippet of my code, where this component is wrapped by a parent AuthKitProvider

const { qrCodeUri } = useSignIn({ onSuccess: () => undefined })
console.log(qrCodeUri)

and qrCodeUri is undefined on every render.

@jackycymo
Copy link

jackycymo commented Apr 19, 2024

qrCodeUri seems to be updated to url in 0.2.2 and going through the code in <SigninButton> it seems that we need to first add these lines, then url will be available

useEffect(() => {
if (!channelToken) {
connect();
}
}, [channelToken, connect]);

Might be a bug though since it's not mentioned in the docs. This logic should probably be included in useSignIn() when it's first initiated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants