summaryrefslogtreecommitdiff
path: root/src/mongo/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client')
-rw-r--r--src/mongo/client/internal_auth.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mongo/client/internal_auth.cpp b/src/mongo/client/internal_auth.cpp
index 1effff0a08a..59b8d6da5dc 100644
--- a/src/mongo/client/internal_auth.cpp
+++ b/src/mongo/client/internal_auth.cpp
@@ -104,8 +104,8 @@ BSONObj getInternalAuthParams(size_t idx, StringData mechanism) {
auto password = internalAuthKeys.at(idx);
if (mechanism == kMechanismScramSha1) {
- password = mongo::createPasswordDigest(
- internalSecurity.user->getName().getUser().toString(), password);
+ password =
+ mongo::createPasswordDigest(internalSecurity.user->getName().getUser(), password);
}
return BSON(saslCommandMechanismFieldName
@@ -131,8 +131,11 @@ std::string getInternalAuthDB() {
return getBSONString(internalAuthParams, saslCommandUserDBFieldName);
}
- auto isu = internalSecurity.user;
- return isu ? isu->getName().getDB().toString() : "admin";
+ if (auto isu = internalSecurity.user) {
+ return isu->getName().getDB();
+ }
+
+ return "admin";
}
} // namespace auth