X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreauthhandler.cpp;h=d8f81abe516d0801f8bce7f75c71036001e31969;hp=ee505a7455e3af870fbe3939ca5104d3a4c6c10f;hb=8efbb2ef22f5f007b5dc6d5b15ecf070ccef08ca;hpb=af29862368978b94f00f13b957f685d78c7e8104 diff --git a/src/core/coreauthhandler.cpp b/src/core/coreauthhandler.cpp index ee505a74..d8f81abe 100644 --- a/src/core/coreauthhandler.cpp +++ b/src/core/coreauthhandler.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -228,7 +228,17 @@ void CoreAuthHandler::handle(const Protocol::Login& msg) // 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); + + // Check to see if the user has the "Database" authenticator configured. + UserId uid = 0; + if (Core::getUserAuthenticator(msg.user) == "Database") { + uid = Core::validateUser(msg.user, msg.password); + } + + // If they did not, *or* if the database login fails, try to use a different authenticator. + // TODO: this logic should likely be moved into Core::authenticateUser in the future. + // Right now a core can only have one authenticator configured; this might be something + // to change in the future. if (uid == 0) { uid = Core::authenticateUser(msg.user, msg.password); }