19 lines
431 B
JavaScript
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,
|
|
};
|