Fixed login in case an account gets two pending tokens assigned
Not entirely sure if this is what was happening, but if a
PAMSG_LOGIN_RNDTRGR
was handled, a new pending account was always
created and appended to mPendingAccounts
. However, when handling the
follow-up PAMSG_LOGIN
, only the first pending account with matching
username was checked, which could result in a failed login due to
mismatching token.
Resolved this issue by unifying the client-specific random token with
the Stellar token stored on the AccountClient
. This means the username
value in PAMSG_LOGIN_RNDTRGR
could be removed.
Eventually it would also be nice to simplify this further such that the token is automatically sent to the client after connecting rather than being something that needs to be requested.