summaryrefslogtreecommitdiff
path: root/src/account-server/accounthandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/account-server/accounthandler.cpp')
-rw-r--r--src/account-server/accounthandler.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index b13b4580..a59e1aa1 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -597,18 +597,13 @@ void AccountHandler::handleRegisterMessage(AccountClient &client,
}
else
{
- // We hash email server-side for additional privacy we ask for it again
+ // We hash email server-side for additional privacy. We ask for it again
// when we need it and verify it through comparing it with the hash.
- std::unique_ptr<Account> acc = createAccount(username,
- sha256(password),
- sha256(email));
+ client.setAccount(createAccount(username, sha256(password), sha256(email)));
+ client.status = CLIENT_CONNECTED;
reply.writeInt8(ERRMSG_OK);
addServerInfo(reply);
-
- // Associate account with connection
- client.setAccount(std::move(acc));
- client.status = CLIENT_CONNECTED;
}
client.send(reply);
@@ -1017,7 +1012,7 @@ std::unique_ptr<Account> AccountHandler::createAccount(const std::string &userna
const std::string &password,
const std::string &email)
{
- std::unique_ptr<Account> acc { new Account };
+ auto acc = std::make_unique<Account>();
acc->setName(username);
acc->setPassword(password);
acc->setEmail(email);