cinny/src/client/state/auth.js

20 lines
431 B
JavaScript
Raw Normal View History

2021-07-28 16:15:52 +03:00
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,
};