Skip to content

Commit

Permalink
Fix clould auth (vesoft-inc#941)
Browse files Browse the repository at this point in the history
Co-authored-by: Yichen Wang <18348405+Aiee@users.noreply.github.com>
  • Loading branch information
nebula-bots and Aiee authored Jun 10, 2022
1 parent 771a861 commit 63322aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/graph/service/GraphService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ Status GraphService::auth(const std::string& username,
// There is no way to identify which one is in the graph layer,
// let's check the native user's password first, then cloud user.
auto pwdAuth = std::make_unique<PasswordAuthenticator>(metaClient);
return pwdAuth->auth(username, proxygen::md5Encode(folly::StringPiece(password)));
auto pwdAuthRes = pwdAuth->auth(username, proxygen::md5Encode(folly::StringPiece(password)));
if (pwdAuthRes.ok()) {
return Status::OK();
}

// Password auth failed, try cloud token
auto cloudAuth = std::make_unique<CloudAuthenticator>(metaClient);
return cloudAuth->auth(username, password);
} else if (FLAGS_auth_type == "ldap") {
Expand Down

0 comments on commit 63322aa

Please sign in to comment.