cinny/src/client/state/auth.js
marcin mikołajczak d6d1b0eeef Fix typo
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-09-14 09:30:37 +02:00

19 lines
431 B
JavaScript

import cons from './cons';
function getSecret(key) {
return localStorage.getItem(key);
}
const isAuthenticated = () => 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 {
isAuthenticated,
secret,
};