summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Kittenbrink <brad@lindenlab.com>2022-03-18 15:22:29 -0700
committerBrad Kittenbrink <brad@lindenlab.com>2022-03-18 15:22:29 -0700
commit22a22d17b4c10606cb36a35c92ed627ba2d8aa69 (patch)
treea6da060d6cb92c9484dfec205f1a127d3a436d93 /indra/newview
parent6bdd744d78f2040767abe57afcb06f8a55a9dd83 (diff)
Fix SL-17034/BUG-231938 whitespace in token causes authentication failure
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lllogininstance.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index 2335674501..523d39da58 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -61,6 +61,7 @@
#include "lltrans.h"
#include <boost/scoped_ptr.hpp>
+#include <boost/regex.hpp>
#include <sstream>
const S32 LOGIN_MAX_RETRIES = 0; // Viewer should not autmatically retry login
@@ -448,10 +449,13 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
LLSD payload;
LLNotificationsUtil::add("PromptMFAToken", args, payload, [=](LLSD const & notif, LLSD const & response) {
bool continue_clicked = response["continue"].asBoolean();
- LLSD token = response["token"];
+ std::string token = response["token"].asString();
LL_DEBUGS("LLLogin") << "PromptMFAToken: response: " << response << " continue_clicked" << continue_clicked << LL_ENDL;
- if (continue_clicked && !token.asString().empty())
+ // strip out whitespace - SL-17034/BUG-231938
+ token = boost::regex_replace(token, boost::regex("\\s"), "");
+
+ if (continue_clicked && !token.empty())
{
LL_INFOS("LLLogin") << "PromptMFAToken: token submitted" << LL_ENDL;