From 98dd12a2ccf16d9889b9a97b8ddf6ad64011f9c4 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 26 May 2023 13:03:23 +0200 Subject: 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. --- src/account-server/accountclient.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/account-server/accountclient.h') diff --git a/src/account-server/accountclient.h b/src/account-server/accountclient.h index 5ccb0f1d..6c64e2f6 100644 --- a/src/account-server/accountclient.h +++ b/src/account-server/accountclient.h @@ -51,7 +51,7 @@ class AccountClient : public NetComputer AccountClientStatus status; int version; - std::string stellarToken; + std::string token; private: std::unique_ptr mAccount; -- cgit v1.2.3-70-g09d2