- //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);
- }
-
+ if (!Core::isConfigured()) {
+ qWarning() << qPrintable(tr("Client")) << qPrintable(socket()->peerAddress().toString())
+ << qPrintable(tr("attempted to login before the core was configured, rejecting."));
+ _peer->dispatch(Protocol::ClientDenied(
+ tr("<b>Attempted to login before core was configured!</b><br>The core must be configured before attempting to login.")));
+ return;
+ }
+
+ // 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);
+ }
+