MoralisWeb3/unity-web3-game-kit

await Moralis.LogInAsync(username, password) Does Not Set AuthenticationKitState to Connected

vrxgaminginc opened this issue · 2 comments

When calling await Moralis.LogInAsync(username, password), the AuthenticationKitState does not change to Connected. However, once the user has been logged in and the application is restarted, Moralis reads the LoginAsync user from cache and does change the state to Connected. This leads to other bugs because the user is connected but the AuthenticationKitState is still in Initialized state.

Workaround is to set the state manually after successful login but the State is private, so need to change the packaging code.

Hi @vrxgaminginc, currently the AuthenticationKitState does not handle external state changes but this will be added in the near future. For now you could do a await AuthenticationKit.InitializeAsync(); after the user is connected with Moralis.LogInAsync to work around this.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.