Commit 46f26058 authored by Paweł Wegner's avatar Paweł Wegner

Request: don't wait for auth to finish.

parent 20fc266e
......@@ -112,6 +112,18 @@ void AuthorizeRequest::cancel() {
Request::cancel();
}
void AuthorizeRequest::finish() {
{
std::lock_guard<std::mutex> lock(provider_mutex_);
if (provider()) {
std::lock_guard<std::mutex> lock(
provider()->current_authorization_mutex_);
if (!provider()->auth_callbacks_.empty()) return;
}
}
Request::finish();
}
void AuthorizeRequest::set_server(std::shared_ptr<IHttpServer> p) {
std::unique_lock<std::mutex> lock(lock_);
auth_server_ = p;
......
......@@ -42,7 +42,8 @@ class AuthorizeRequest : public Request<EitherError<void>> {
void oauth2Authorization(AuthorizeCompleted);
void sendCancel();
void cancel();
void cancel() override;
void finish() override;
void set_server(std::shared_ptr<IHttpServer>);
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment