From 22a22d17b4c10606cb36a35c92ed627ba2d8aa69 Mon Sep 17 00:00:00 2001 From: Brad Kittenbrink Date: Fri, 18 Mar 2022 15:22:29 -0700 Subject: Fix SL-17034/BUG-231938 whitespace in token causes authentication failure --- indra/newview/lllogininstance.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview') 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 +#include #include 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; -- cgit v1.2.3