From f62b2345f463695ef0f8f79830cd76b6e0332821 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Sat, 13 Jan 2024 10:35:22 +0700 Subject: Refactor src migrate folder --- src-migrate/common/libs/auth.ts | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src-migrate/common/libs/auth.ts (limited to 'src-migrate/common/libs/auth.ts') diff --git a/src-migrate/common/libs/auth.ts b/src-migrate/common/libs/auth.ts deleted file mode 100644 index fb4e836a..00000000 --- a/src-migrate/common/libs/auth.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { deleteCookie, getCookie, setCookie } from 'cookies-next'; -import { AuthProps } from '../types/auth'; - -const COOKIE_KEY = 'auth'; - -export const getAuth = (): AuthProps | boolean => { - const auth = getCookie(COOKIE_KEY); - - if (typeof auth === 'string') { - return JSON.parse(auth); - } - - return false; -}; - -export const setAuth = (user: AuthProps): boolean => { - setCookie(COOKIE_KEY, JSON.stringify(user)); - - return true; -}; - -export const deleteAuth = (): boolean => { - deleteCookie(COOKIE_KEY); - - return true; -}; -- cgit v1.2.3