worldwide-asset-exchange / waxjs

Javascript API for integration with the WAX Cloud Wallet.
MIT License
126 stars 103 forks source link

Broken programmatic login and logout #174

Open isebarn opened 7 months ago

isebarn commented 7 months ago

1. Programmatically logging in the user: From documentation

The library can also be instantiated with the user account and the public keys. Due to the library contains the user information, the login step can be avoided.

const wax = new waxjs.WaxJS({
  rpcEndpoint: 'https://wax.greymass.com',
  userAccount: 'user1',
  pubKeys: ['EOS7rC8jFvFrPYDqp3Nh3HdRfL79h11B1JhPEXy85enF5wwYzF3Hk']
});

this doesnt work

2. Logging out of an account: From documentation

You can now log a user out of the waxjs library, this is usefull if you want to logout one user and let them login with another account. To do this just call wax.logout() that will be enough.

this doesnt work

niksad8 commented 7 months ago

thanks looking it to it

includenull commented 7 months ago

@isebarn Can you expand on what doesn't work with these?

I have tested initiating with account and keys and this is working correctly for me.
If the user is not logged in to Cloud Wallet with the correct account they will have to do so the next time they sign a transaction.

This method also can not be used to switch users between Cloud Wallet accounts since they can only be logged in to one at a time.

wax.logout() should also be used in conjunction with tryAutoLogin: false because if the user is logged in to Cloud Wallet and has auto login enabled then they will get automatically logged back if the page of your app reloads.

isebarn commented 7 months ago

@includenull what web framework are you using? I've tried with both VueJS and React