import SafeStorage, { AppStorageKey } from "@/utils/safeStorage";

const isLogin = () => !!SafeStorage.get(AppStorageKey.TOKEN)

const getToken = () => SafeStorage.get(AppStorageKey.TOKEN)

const setToken = (token: string) => {
  SafeStorage.set(AppStorageKey.TOKEN, token)
}

const clearToken = () => {
  SafeStorage.remove(AppStorageKey.TOKEN)
}

export { clearToken, getToken, isLogin, setToken }
