feat(auth): persist cookie based apiKey in document.cookie (#8689)

Refs #8683
This commit is contained in:
Vladimír Gorej
2023-05-22 14:46:30 +02:00
committed by GitHub
parent 26709c3ea6
commit 7ac9a8f070
10 changed files with 269 additions and 64 deletions

View File

@@ -273,11 +273,12 @@ export function restoreAuthorization(payload) {
export const persistAuthorizationIfNeeded = () => ( { authSelectors, getConfigs } ) => {
const configs = getConfigs()
if (configs.persistAuthorization)
{
const authorized = authSelectors.authorized()
localStorage.setItem("authorized", JSON.stringify(authorized.toJS()))
}
if (!configs.persistAuthorization) return
// persist authorization to local storage
const authorized = authSelectors.authorized().toJS()
localStorage.setItem("authorized", JSON.stringify(authorized))
}
export const authPopup = (url, swaggerUIRedirectOauth2) => ( ) => {