260508_10_ENH: 새로고침 시 로그인 풀리는 문제 수정 중
This commit is contained in:
@@ -22,7 +22,7 @@ const parseStoredValue = (value: string): StorageValue => {
|
|||||||
|
|
||||||
const stringifyStorageValue = (value: StorageValue): string => {
|
const stringifyStorageValue = (value: StorageValue): string => {
|
||||||
const stringifyValue = JSON.stringify(value);
|
const stringifyValue = JSON.stringify(value);
|
||||||
return clientEnv.ENV === "prod" ? Security.encryptBase64(stringifyValue) : stringifyValue;
|
return stringifyValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setLocalStorage = (key: string, value: StorageValue): void => {
|
export const setLocalStorage = (key: string, value: StorageValue): void => {
|
||||||
@@ -46,8 +46,7 @@ export const getLocalStorage = (key: string): StorageValue => {
|
|||||||
try {
|
try {
|
||||||
return JSON.parse(storedValue);
|
return JSON.parse(storedValue);
|
||||||
} catch (fallbackError) {
|
} catch (fallbackError) {
|
||||||
localStorage.removeItem(key);
|
console.warn("[storage] localStorage parse failed", {
|
||||||
console.warn("[storage] localStorage parse failed; removed corrupted value", {
|
|
||||||
key,
|
key,
|
||||||
decryptError,
|
decryptError,
|
||||||
fallbackError,
|
fallbackError,
|
||||||
@@ -90,8 +89,7 @@ export const getSessionStorage = (key: string): StorageValue => {
|
|||||||
try {
|
try {
|
||||||
return JSON.parse(storedValue);
|
return JSON.parse(storedValue);
|
||||||
} catch (fallbackError) {
|
} catch (fallbackError) {
|
||||||
sessionStorage.removeItem(key);
|
console.warn("[storage] sessionStorage parse failed", {
|
||||||
console.warn("[storage] sessionStorage parse failed; removed corrupted value", {
|
|
||||||
key,
|
key,
|
||||||
decryptError,
|
decryptError,
|
||||||
fallbackError,
|
fallbackError,
|
||||||
|
|||||||
Reference in New Issue
Block a user