diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-23 09:22:29 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-23 09:22:29 +0700 |
| commit | c13bb5c6f78032695b24cf8a6c23942eb465c6d5 (patch) | |
| tree | e48c1ab39a61fd5702f578fbfdb7a7375cc1ce43 /src-migrate/libs/auth.ts | |
| parent | 870bede9df9920b23f2e5cb771ff5ae6448e3ac7 (diff) | |
| parent | 4bd29979c34c1ec3b31dd384829b008eb726769c (diff) | |
Merge branch 'Feature/new-register' into Feature/switch-account
Diffstat (limited to 'src-migrate/libs/auth.ts')
| -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; }; |
