initial commit
This commit is contained in:
19
src/client/state/auth.js
Normal file
19
src/client/state/auth.js
Normal file
@@ -0,0 +1,19 @@
|
||||
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,
|
||||
};
|
||||
Reference in New Issue
Block a user