diff --git a/src/helpers/localStorage.ts b/src/helpers/localStorage.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/src/helpers/localStorage.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/src/helpers/userToken.ts b/src/helpers/userToken.ts new file mode 100644 index 0000000..1eef217 --- /dev/null +++ b/src/helpers/userToken.ts @@ -0,0 +1,12 @@ +type UserToken = { + accessToken: string; + refreshToken: string; +}; + +export const getToken = (): UserToken | string => { + return JSON.parse(localStorage.getItem('UserToken') || ''); +}; + +export const setToken = (token: UserToken) => { + localStorage.setItem('UserToken', JSON.stringify(token)); +};