- 
                Notifications
    You must be signed in to change notification settings 
- Fork 167
Description
Expected Behavior
Describe expected behavior
If performAuthorizationRequest is called more than once without completing the flow of the first call, the authorization flow from the first call should still be able to finish.
Describe the problem
Actual Behavior
After two calls to performAuthorizationRequest Server from first call to performAuthorizationRequest is still alive, if it receives a valid authorization response, it resolves the this.authorizationResponse Promise. But with the second call to performAuthorizationRequest the this.authorizationResponse promise from the first call to performAuthorizationRequest gets replaced with another one.
The first call therefore resolves a promise which is not anymore "accessible". The call to completeAuthorizationRequest invoked by completeAuthorizationRequestIfPossible returns the this.authorizationResponse promise, which throws an error or never resolves in the case of #95.
The user could only sign in, after restarting the app.
Steps to reproduce the behavior
1.) Start the example electron app (googlesamples/appauth-js-electron-sample)
2.) Click "Sign in"
3.) Go back to the app without completing consent screen, but keeping the tab open
4.) Click "Sign in" again
5.) Close newly opened tab without completing consent screen
6.) Complete consent screen in the tab opened with the first click on "Sign in"
Environment
- AppAuth-JS version: 1.2.6
- AppAuth-JS Environment : Node