summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/security_token_authentication_guard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/auth/security_token_authentication_guard.cpp')
-rw-r--r--src/mongo/db/auth/security_token_authentication_guard.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/auth/security_token_authentication_guard.cpp b/src/mongo/db/auth/security_token_authentication_guard.cpp
index a8f86fa240d..5be6de3dc75 100644
--- a/src/mongo/db/auth/security_token_authentication_guard.cpp
+++ b/src/mongo/db/auth/security_token_authentication_guard.cpp
@@ -41,9 +41,9 @@ namespace auth {
SecurityTokenAuthenticationGuard::SecurityTokenAuthenticationGuard(
OperationContext* opCtx, const ValidatedTenancyScope& token) {
if (token.hasAuthenticatedUser()) {
- UserRequest request(token.authenticatedUser(), boost::none);
+ const auto& userName = token.authenticatedUser();
auto* client = opCtx->getClient();
- uassertStatusOK(AuthorizationSession::get(client)->addAndAuthorizeUser(opCtx, request));
+ uassertStatusOK(AuthorizationSession::get(client)->addAndAuthorizeUser(opCtx, userName));
_client = client;
LOGV2_DEBUG(5838100,