summaryrefslogtreecommitdiff
path: root/indra/newview/lllogininstance.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-10-03 19:46:29 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-10-03 19:55:49 +0300
commit878fb36a0bb632f5e541b132a7ded5eb047ff947 (patch)
tree9280a9ce33ddec5e186526077c7edcba2f6fe736 /indra/newview/lllogininstance.cpp
parentbcfd5d5279f1796abaf347d2276d2a0b9983f35e (diff)
parent2465470817957c8378e81ec1a7e32551fbac7b26 (diff)
Merge branch 'main' into DRTVWR-591-maint-X
# Conflicts: # indra/newview/app_settings/settings.xml # indra/newview/llinventorybridge.cpp # indra/newview/lltexturectrl.h # indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/newview/lllogininstance.cpp')
-rw-r--r--indra/newview/lllogininstance.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index dd8c9b2dde..01496fa7ce 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -87,6 +87,7 @@ LLLoginInstance::LLLoginInstance() :
mLoginModule(new LLLogin()),
mNotifications(NULL),
mLoginState("offline"),
+ mSaveMFA(true),
mAttemptComplete(false),
mTransferRate(0.0f),
mDispatcher("LLLoginInstance", "change")
@@ -449,10 +450,7 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
gViewerWindow->setShowProgress(FALSE);
}
- LLSD args(llsd::map( "MESSAGE", LLTrans::getString(response["message_id"]) ));
- LLSD payload;
- LLNotificationsUtil::add("PromptMFAToken", args, payload,
- boost::bind(&LLLoginInstance::handleMFAChallenge, this, _1, _2));
+ showMFAChallange(LLTrans::getString(response["message_id"]));
}
else if( reason_response == "key"
|| reason_response == "presence"
@@ -540,10 +538,7 @@ bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key)
{
// SL-18511 this TOS failure happened while we are in the middle of an MFA challenge/response.
// the previously entered token is very likely expired, so prompt again
- LLSD args(llsd::map( "MESSAGE", LLTrans::getString("LoginFailedAuthenticationMFARequired") ));
- LLSD payload;
- LLNotificationsUtil::add("PromptMFAToken", args, payload,
- boost::bind(&LLLoginInstance::handleMFAChallenge, this, _1, _2));
+ showMFAChallange(LLTrans::getString("LoginFailedAuthenticationMFARequired"));
}
else
{
@@ -561,6 +556,22 @@ bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key)
return true;
}
+void LLLoginInstance::showMFAChallange(const std::string& message)
+{
+ LLSD args(llsd::map("MESSAGE", message));
+ LLSD payload;
+ if (gSavedSettings.getBOOL("RememberUser"))
+ {
+ LLNotificationsUtil::add("PromptMFATokenWithSave", args, payload,
+ boost::bind(&LLLoginInstance::handleMFAChallenge, this, _1, _2));
+ }
+ else
+ {
+ LLNotificationsUtil::add("PromptMFAToken", args, payload,
+ boost::bind(&LLLoginInstance::handleMFAChallenge, this, _1, _2));
+ }
+}
+
bool LLLoginInstance::handleMFAChallenge(LLSD const & notif, LLSD const & response)
{
bool continue_clicked = response["continue"].asBoolean();
@@ -576,6 +587,7 @@ bool LLLoginInstance::handleMFAChallenge(LLSD const & notif, LLSD const & respon
// Set the request data to true and retry login.
mRequestData["params"]["token"] = token;
+ mSaveMFA = response.has("ignore") ? response["ignore"].asBoolean() : false;
reconnect();
} else {
LL_INFOS("LLLogin") << "PromptMFAToken: no token, attemptComplete" << LL_ENDL;