mirror of https://gitee.com/bigwinds/arangodb
fix authentication
This commit is contained in:
parent
e230e3e2c5
commit
6fa320299e
|
@ -240,15 +240,15 @@ bool VppCommTask::processRead() {
|
||||||
if (type == 1000) {
|
if (type == 1000) {
|
||||||
// do authentication
|
// do authentication
|
||||||
std::string encryption = header.at(2).copyString();
|
std::string encryption = header.at(2).copyString();
|
||||||
std::string user = header.at(2).copyString();
|
std::string user = header.at(3).copyString();
|
||||||
std::string pass = header.at(3).copyString();
|
std::string pass = header.at(4).copyString();
|
||||||
auto auth = basics::StringUtils::encodeBase64(user + ":" + pass);
|
auto auth = basics::StringUtils::encodeBase64(user + ":" + pass);
|
||||||
AuthResult result = GeneralServerFeature::AUTH_INFO.checkAuthentication(
|
AuthResult result = GeneralServerFeature::AUTH_INFO.checkAuthentication(
|
||||||
AuthInfo::AuthType::BASIC, auth);
|
AuthInfo::AuthType::BASIC, auth);
|
||||||
|
|
||||||
if (result._authorized) {
|
if (result._authorized) {
|
||||||
_authenticatedUser = std::move(user);
|
_authenticatedUser = std::move(user);
|
||||||
handleSimpleError(rest::ResponseCode::I_AM_A_TEAPOT, TRI_ERROR_NO_ERROR,
|
handleSimpleError(rest::ResponseCode::OK, TRI_ERROR_NO_ERROR,
|
||||||
"authentication successful", chunkHeader._messageID);
|
"authentication successful", chunkHeader._messageID);
|
||||||
} else {
|
} else {
|
||||||
_authenticatedUser.clear();
|
_authenticatedUser.clear();
|
||||||
|
|
Loading…
Reference in New Issue