Commit 494158bc authored by jan.koester's avatar jan.koester
Browse files

reconnect if failed

parent 244fe7e4
Loading
Loading
Loading
Loading
+9 −2
Changes for src/auth.cpp: 9 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -115,9 +115,16 @@ bool blogi::Auth::isLoggedIn(const int tid,libhttppp::HttpRequest &curreq,const
            authcon.setClientSecret(_config.getClientSecret());
            authcon.setSessionID(sessid);

            authdb::client::Client clt(authcon);
            std::unique_ptr<authdb::client::Client>clt;

            try{
                clt=std::make_unique<authdb::client::Client>(authcon);
            }catch(...){
                authcon.reConnect();
                clt=std::make_unique<authdb::client::Client>(authcon);
            }

            if(clt.ClientAuth() && clt.GPOcheck("e7d3b8b3-4825-11f0-ae2b-3cecefce9cb6")){
            if(clt->ClientAuth() && clt->GPOcheck("e7d3b8b3-4825-11f0-ae2b-3cecefce9cb6")){
                return true;
            }
        }catch(...){};