As per the documentation, we are supposed to use the following code to authenticate a user using the api:
The above code was also responsible for opening the login popup.
Now, in order to detect the login window’s close event, the above code needs to be replaced with the following code:
var linkedin = IN.UI.Authorize().place();
// perform some action