File tree Expand file tree Collapse file tree 2 files changed +13
-21
lines changed
Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -99,28 +99,24 @@ class oauth1_code_listener
9999 m_listener->support ([this ](http::http_request request) -> void
100100 {
101101 pplx::extensibility::scoped_critical_section_t lck (m_resplock);
102- if (request.request_uri (). path () == U ( " / " ) && request. request_uri (). query () != U ( " " ))
102+ m_config. token_from_redirected_uri (request.request_uri ()). then ([ this , request](pplx::task< void > token_task) -> void
103103 {
104- m_config. token_from_redirected_uri (request.request_uri ()). then ([ this ,request](pplx::task< void > token_task) -> void
104+ if (request.request_uri (). path () == U ( " / " ) && request. request_uri (). query () != U ( " " ))
105105 {
106106 try
107107 {
108108 token_task.wait ();
109- request.reply (status_codes::OK, U (" Ok." ));
110109 m_tce.set (true );
111110 }
112111 catch (oauth1_exception& e)
113112 {
114113 ucout << " Error: " << e.what () << std::endl;
115- request.reply (status_codes::NotFound, U (" Not found." ));
116114 m_tce.set (false );
117115 }
118- });
119- }
120- else
121- {
122- request.reply (status_codes::NotFound, U (" Not found." ));
123- }
116+ }
117+ });
118+
119+ request.reply (status_codes::OK, U (" Ok." ));
124120 });
125121 m_listener->open ().wait ();
126122 }
Original file line number Diff line number Diff line change @@ -99,28 +99,24 @@ class oauth2_code_listener
9999 m_listener->support ([this ](http::http_request request) -> void
100100 {
101101 pplx::extensibility::scoped_critical_section_t lck (m_resplock);
102- if (request.request_uri (). path () == U ( " / " ) && request. request_uri (). query () != U ( " " ))
102+ m_config. token_from_redirected_uri (request.request_uri ()). then ([ this , request](pplx::task< void >token_task) -> void
103103 {
104- m_config. token_from_redirected_uri (request.request_uri ()). then ([ this ,request](pplx::task< void > token_task) -> void
104+ if (request.request_uri (). path () == U ( " / " ) && request. request_uri (). query () != U ( " " ))
105105 {
106106 try
107107 {
108108 token_task.wait ();
109- request.reply (status_codes::OK, U (" Ok." ));
110109 m_tce.set (true );
111110 }
112- catch (oauth2_exception & e)
111+ catch (oauth1_exception & e)
113112 {
114113 ucout << " Error: " << e.what () << std::endl;
115- request.reply (status_codes::NotFound, U (" Not found." ));
116114 m_tce.set (false );
117115 }
118- });
119- }
120- else
121- {
122- request.reply (status_codes::NotFound, U (" Not found." ));
123- }
116+ }
117+ });
118+
119+ request.reply (status_codes::OK, U (" Ok." ));
124120 });
125121 m_listener->open ().wait ();
126122 }
You can’t perform that action at this time.
0 commit comments