Files
cinny/src/client/state/auth.js
T

20 lines
431 B
JavaScript
Raw Normal View History

2021-07-28 18:45:52 +05:30
import cons from './cons';
function getSecret(key) {
return localStorage.getItem(key);
}
2021-09-14 09:30:37 +02:00
const isAuthenticated = () => getSecret(cons.secretKey.ACCESS_TOKEN) !== null;
2021-07-28 18:45:52 +05:30
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 {
2021-09-14 09:30:37 +02:00
isAuthenticated,
2021-07-28 18:45:52 +05:30
secret,
};