feat(oauth2): authActions.authPopup plugin accessible wrapper (#7699)

* enables win.open to be extensible by plugins

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
This commit is contained in:
Maciej Kowalski
2022-03-10 23:44:46 +01:00
committed by GitHub
parent a5aca55f58
commit 8f63462f9e
4 changed files with 65 additions and 50 deletions

View File

@@ -1,5 +1,4 @@
import parseUrl from "url-parse"
import win from "core/window"
import Im from "immutable"
import { btoa, sanitizeUrl, generateCodeVerifier, createCodeChallenge } from "core/utils"
@@ -123,13 +122,11 @@ export default function authorize ( { auth, authActions, errActions, configs, au
callback = authActions.authorizeAccessCodeWithFormParams
}
win.swaggerUIRedirectOauth2 = {
authActions.authPopup(url, {
auth: auth,
state: state,
redirectUrl: redirectUrl,
callback: callback,
errCb: errActions.newAuthErr
}
win.open(url)
})
}