From e8c60b3215c91dbbc96dd4a522555a9b3cb63005 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 2 Jul 2021 13:53:11 +0200 Subject: [PATCH] utils: add getOpenIDRedirectionAuthorization: to avoid code-duplication Signed-off-by: Thomas Lamprecht --- src/Utils.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Utils.js b/src/Utils.js index bc602de..7f32f05 100644 --- a/src/Utils.js +++ b/src/Utils.js @@ -279,6 +279,16 @@ utilities: { window.localStorage.removeItem("ProxmoxUser"); }, + // The End-User gets redirected back here after login on the OpenID auth. portal, and in the + // redirection URL the state and auth.code are passed as URL GET params, this helper parses those + getOpenIDRedirectionAuthorization: function() { + const auth = Ext.Object.fromQueryString(window.location.search); + if (auth.state !== undefined && auth.code !== undefined) { + return auth; + } + return undefined; + }, + // comp.setLoading() is buggy in ExtJS 4.0.7, so we // use el.mask() instead setErrorMask: function(comp, msg) { -- 2.39.2