cinny/src/client/state/auth.js
2021-07-28 18:45:52 +05:30

19 lines
431 B
JavaScript

import cons from './cons';
function getSecret(key) {
return localStorage.getItem(key);
}
const isAuthanticated = () => getSecret(cons.secretKey.ACCESS_TOKEN) !== null;
const secret = {
accessToken: getSecret(cons.secretKey.ACCESS_TOKEN),
deviceId: getSecret(cons.secretKey.DEVICE_ID),
userId: getSecret(cons.secretKey.USER_ID),
baseUrl: getSecret(cons.secretKey.BASE_URL),
};
export {
isAuthanticated,
secret,
};