cpprestsdk icon indicating copy to clipboard operation
cpprestsdk copied to clipboard

Oauth1Client. How to detect browser close event ?

Open thienphuoc opened this issue 4 years ago • 0 comments

Hi, I have tried many methods to detect browser close events. But, Unfortunately, I have not been able to detect the close.

image

I used this example here for google/facebook login: https://github.com/microsoft/cpprestsdk/blob/master/Release/samples/Oauth1Client/Oauth1Client.cpp

And I added this callback as below, but the result always returns "Completed" :

image

Could somebody give me some solution for this problem?

    _listener = new http_listener(url);
    _listener->support([this](http::http_request request) {

 //my code

        request.reply(web::http::status_codes::OK, json::value::string(U("Login success. Please close website!"))).then([this](pplx::task<void> result) {
         //my code
        });

    });

    _listener->open().then([this](pplx::task<void> result) {

      //my code
    }).wait();

thienphuoc avatar Oct 19 '21 07:10 thienphuoc