diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-08-31 09:25:53 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-08-31 09:25:53 +0700 |
| commit | 6a0c477de3df773f2a818b904029624c212f083f (patch) | |
| tree | e1f7a09eb83509de594fe7dbb015a71dd18cec26 /src-migrate/libs | |
| parent | 3de1a412bba31b19b8b443dd91df8aff8d6eda07 (diff) | |
| parent | c6e970598c6c23f0606d1bc19036f0decd57cc05 (diff) | |
Merge branch 'release' into Feature/new-cart-popup
Diffstat (limited to 'src-migrate/libs')
| -rw-r--r-- | src-migrate/libs/auth.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src-migrate/libs/auth.ts b/src-migrate/libs/auth.ts index 86ce26e1..e8516747 100644 --- a/src-migrate/libs/auth.ts +++ b/src-migrate/libs/auth.ts @@ -1,5 +1,8 @@ import { deleteCookie, getCookie, setCookie } from 'cookies-next'; import { AuthProps } from '~/types/auth'; +// @ts-ignore +import camelcaseObjectDeep from 'camelcase-object-deep'; + const COOKIE_KEY = 'auth'; @@ -14,7 +17,7 @@ export const getAuth = (): AuthProps | boolean => { }; export const setAuth = (user: AuthProps): boolean => { - setCookie(COOKIE_KEY, JSON.stringify(user)); + setCookie(COOKIE_KEY, JSON.stringify(camelcaseObjectDeep(user))); return true; }; |
