summaryrefslogtreecommitdiffstats
path: root/src/modules/AuthBackendPassword
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/AuthBackendPassword')
-rw-r--r--src/modules/AuthBackendPassword/AuthBackendPassword.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/AuthBackendPassword/AuthBackendPassword.cpp b/src/modules/AuthBackendPassword/AuthBackendPassword.cpp
index 7e5aca9..1b38002 100644
--- a/src/modules/AuthBackendPassword/AuthBackendPassword.cpp
+++ b/src/modules/AuthBackendPassword/AuthBackendPassword.cpp
@@ -28,14 +28,14 @@ const std::string AuthBackendPassword::methodName = "Password";
boost::shared_ptr<Common::AuthContext> AuthBackendPassword::authenticate(boost::shared_ptr<Common::AuthProvider> provider, const std::string &subMethod,
const std::string &user, const std::vector<boost::uint8_t> &data, std::vector<boost::uint8_t>& /*response*/,
boost::shared_ptr<Common::AuthContext> context) throw(Core::Exception) {
- if(context.get() != 0 && dynamic_cast<AuthContextPassword*>(context.get()) == 0)
+ if(context && dynamic_cast<AuthContextPassword*>(context.get()) == 0)
throw(Core::Exception(Core::Exception::INVALID_INPUT));
std::vector<std::string> allowedMethods = getSubMethods(provider);
if(std::find(allowedMethods.begin(), allowedMethods.end(), subMethod) == allowedMethods.end())
throw(Core::Exception(Core::Exception::INVALID_INPUT));
- if(context.get() == 0)
+ if(!context)
context.reset(new AuthContextPassword);
if(!provider->checkPassword(user, data, subMethod))