Commit 203c2a69 authored by jan.koester's avatar jan.koester
Browse files

test

parent d1c0eee0
Loading
Loading
Loading
Loading
+14 −0
Changes for src/auth.cpp: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -76,19 +76,33 @@ void blogi::Auth::_doLogin(const AuthSource &src, const char *username, const ch

    authdb::client::Client clt(authcon);

    try {
        if(!clt.ClientAuth()){
            httpException[libhttppp::HTTPException::Error] << "ClientAuth failed!";
            throw httpException;
        }
    } catch (libhttppp::HTTPException&) {
        throw;
    } catch (std::exception &e) {
        httpException[libhttppp::HTTPException::Error] << "ClientAuth error: " << e.what();
        throw httpException;
    }

    authcon.setUsername(username);
    authcon.setUserPassword(password);

    try {
        bool ret = clt.UserAuth();
        if(!ret) {
            httpException[libhttppp::HTTPException::Error] << "UserAuth failed (Invalid credentials)!";
            throw httpException;
        }
    } catch (libhttppp::HTTPException&) {
        throw;
    } catch (std::exception &e) {
        httpException[libhttppp::HTTPException::Error] << "UserAuth error: " << e.what();
        throw httpException;
    }

    try {
        ret = clt.GPOcheck("e7d3b8b3-4825-11f0-ae2b-3cecefce9cb6");