thuang-1840-authn-prompt (#1911)

This commit is contained in:
Timmy Huang
2020-10-08 16:57:53 -07:00
committed by GitHub
parent 6677d0de56
commit c01a2c72b6
3 changed files with 117 additions and 28 deletions
@@ -0,0 +1,22 @@
export const KEYS = {
COOKIE_DECISION: "cxg.cookieDecision",
LOGIN_PROMPT: "cxg.LOGIN_PROMPT",
};
export function storageGet(key, defaultValue = null) {
try {
const val = window.localStorage.getItem(key);
if (val === null) return defaultValue;
return val;
} catch (e) {
return defaultValue;
}
}
export function storageSet(key, value) {
try {
window.localStorage.setItem(key, value);
} catch {
// continue
}
}