First attempt local auth, then try external provider
authorBen Rosser <rosser.bjr@gmail.com>
Mon, 28 Dec 2015 22:18:45 +0000 (17:18 -0500)
committerBen Rosser <rosser.bjr@gmail.com>
Sat, 27 May 2017 17:57:46 +0000 (13:57 -0400)
src/core/coreauthhandler.cpp

index 47c5796..a4c06f3 100644 (file)
@@ -218,12 +218,12 @@ void CoreAuthHandler::handle(const Login &msg)
     if (!checkClientRegistered())
         return;
 
-    //UserId uid = Core::validateUser(msg.user, msg.password);
-    UserId uid = Core::authenticateUser(msg.user, msg.password);
-
-    // Try doing direct database auth if the provider failed, first.
-    if (uid == 0) {
-        uid = Core::validateUser(msg.user, msg.password);
+    // First attempt local auth using the real username and password.
+    // If that fails, move onto the auth provider.
+    UserId uid = Core::validateUser(msg.user, msg.password);
+    if (uid == 0)
+    {
+        uid = Core::authenticateUser(msg.user, msg.password);
     }
 
     if (uid == 0) {