Commit f2a3e409 authored by jan.koester's avatar jan.koester
Browse files

test

parent 1f041219
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -462,7 +462,24 @@ void webedit::Server::handleLogin(libhttppp::HttpRequest &curreq,
    try {
        auto pooled = _authPools[poolIdx]->acquire();

        if (!pooled.client().ClientAuth()) {
        bool clientAuthOk = false;
        try {
            clientAuthOk = pooled.client().ClientAuth();
        } catch (...) {
            clientAuthOk = false;
        }

        if (!clientAuthOk) {
            // Pooled authdb connections can become stale; reconnect and retry once.
            try {
                pooled.connection().reConnect();
                clientAuthOk = pooled.client().ClientAuth();
            } catch (...) {
                clientAuthOk = false;
            }
        }

        if (!clientAuthOk) {
            sendJsonResponse(curreq, HTTP500,
                "{\"error\":\"Client authentication failed\"}", sessionid);
            return;