near / fast-auth-signer

https://fast-auth-signer.vercel.app
MIT License
29 stars 8 forks source link

Problems with `yarn start` on localhost #253

Closed johnnynanjiang closed 2 weeks ago

johnnynanjiang commented 3 weeks ago

yarn start on localhost is pointing to https://api.kitwallet.app and getting error blocked by CORS policy: No 'Access-Control-Allow-Origin' header

Should yarn start be pointing to testnet (https://testnet-api.kitwallet.app) and CORS policy allow localhost?

image

johnnynanjiang commented 3 weeks ago

NETWORK_ID=testnet yarn start solved the problem above

johnnynanjiang commented 3 weeks ago

The app is behaving like this on localhost, is it expected?

https://github.com/near/fast-auth-signer/assets/11918567/459f5b98-89e9-4f68-9ed9-74f413de3314

hcho112 commented 3 weeks ago

@johnnynanjiang I just pulled our latest main branch and run it locally with NETWORK_ID=testnet yarn start on YOURDIRECTORY/fast-auth-signer/packages/near-fast-auth-signer and I got:

image

It should still work. The account you have used above, have you created them with fast-auth first? if not, you should create via http://localhost:3000/create-account.

johnnynanjiang commented 3 weeks ago

Thanks @hcho112

I think the UI is a bit confusing, I got signed in button in RED, then it turned BLUE after seconds.

There is no clear message saying everything is ok, somehow I assume this is the expected behaviour, is that correct?


The following pages didn't work for me, how about you?

/sign
/sign-transaction

This is the web page for /sign

Screenshot 2024-06-13 at 19 00 00
hcho112 commented 3 weeks ago

@johnnynanjiang what you need to understand is that this repo has to be used in a specific way. Not just on it's own. (Signed in button on red to blue was just there for quick UI check. In real world it is not being used. )

Check how it is being used on here

In terms of implementation, how it is being used is: test.near.org (running on top of https://github.com/near/near-discovery) is using setupFastAuthWallet from (https://github.com/near/near-fastauth-wallet) which it points to testnet or mainnet

It may look overly complicated, but it is designed in a way that it naturally integrates with existing NEAR applications and multiple vendors.

Please take a look and let us know if you struggle to understand the flow. Meanwhile, if this issue of problem with yarn start on local environment is not an actual issue, will close the issue shortly

johnnynanjiang commented 3 weeks ago

Thanks @hcho112 for giving me some context, it is helpful for me as a newcomer.

Yes I think it is not a real issue, just some confusion for me to try it out. I believe it would be much clearer overtime with help from community members like you, which is great.

hcho112 commented 3 weeks ago

@johnnynanjiang Thank you for quick feedback and we actually feel sorry that you had to go through bad experience. We are well aware of lack of documentation around fast-auth repos and we are planning to improve them shortly. Thank you for being patient and please feel free to ask questions.

johnnynanjiang commented 3 weeks ago

@hcho112

No problem at all, I'm more than happy to contribute by documenting issues, solutions and context this way, with help from you guys, so it could also help others in the future.

Thanks for your prompt and detailed responses, they helped and made me feel promising going forward with NEAR community.