improve authorization window - #37
Conversation
| this.ownerDocument.defaultView?.removeEventListener("message", onMessage) | ||
| signal.removeEventListener("abort", onAbort) | ||
| this.#switchModal.close() | ||
| this.#authorizationWindow?.close() |
There was a problem hiding this comment.
First substantial change is not closing the authorization window in the provider.
| } | ||
| } | ||
|
|
||
| this.#codeProvider.cleanup() |
There was a problem hiding this comment.
And this is the counterpart: Closing the authorization window from the caller, crucially after a potential fallback in the try above.
There was a problem hiding this comment.
Following https://github.com/solid-contrib/reactive-authentication/pull/37/changes#r3853649238 - this would be a good place to make use of using
| cleanup(): void { | ||
| this.#authorizationWindow?.close() | ||
| } |
There was a problem hiding this comment.
Consider making the AuthorizationCodeFlow class disposable and invoking this in the [Symbol.dispose] function.
This also enables the new using sugar to be used.
This also applies to any other instances of cleanup methods.
| } | ||
| } | ||
|
|
||
| this.#codeProvider.cleanup() |
There was a problem hiding this comment.
Following https://github.com/solid-contrib/reactive-authentication/pull/37/changes#r3853649238 - this would be a good place to make use of using
Supersedes #13 and aims to replicate its functionality but eliminates its code duplication.
This change modifies the functionality of the
so the popup window used for the Authorization Code flow is closed only after the code was received, potentially including after an unsuccessful silent attempt (
prompt=none).Closing the window is now the job of the caller, not the code provider:

For this reason I had converted the code provider from a callback lambda to an interface in 8c32223.