From b398fedc0cfe7394ae8e9df59964620fa23a79c2 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 5 May 2023 12:37:13 +0200 Subject: Added net_stellarLoginUrl configuration The client needs to know the URL to open in the browser. The bare token is still sent as well, which might allow the client to directly interact with a Stellar wallet in the future. --- src/account-server/accounthandler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/account-server/accounthandler.cpp') diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index a59e1aa1..2e4e5c04 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -134,6 +134,7 @@ private: std::string mUpdateHost; std::string mDataUrl; + std::string mStellarLoginUrl; using IPsToTime = std::map; IPsToTime mLastLoginAttemptForIP; @@ -154,7 +155,8 @@ AccountHandler::AccountHandler(const std::string &attributesFile): mMaxCharacters(Configuration::getValue("account_maxCharacters", 3)), mRegistrationAllowed(Configuration::getBoolValue("account_allowRegister", true)), mUpdateHost(Configuration::getValue("net_defaultUpdateHost", std::string())), - mDataUrl(Configuration::getValue("net_clientDataUrl", std::string())) + mDataUrl(Configuration::getValue("net_clientDataUrl", std::string())), + mStellarLoginUrl(Configuration::getValue("net_stellarLoginUrl", std::string())) { XML::Document doc(attributesFile); xmlNodePtr node = doc.rootNode(); @@ -392,6 +394,7 @@ void AccountHandler::handleStellarLoginMessage(AccountClient &client, MessageIn reply.writeInt8(ERRMSG_OK); reply.writeString(client.stellarToken); + reply.writeString(mStellarLoginUrl + "?token=" + client.stellarToken); client.send(reply); } -- cgit v1.2.3-60-g2f50