bigbuffet-rw/app/soapbox/utils/auth.js
2021-03-31 14:47:54 -05:00

14 lines
410 B
JavaScript

export const isLoggedIn = getState => {
return typeof getState().get('me') === 'string';
};
export const getAppToken = state => state.getIn(['auth', 'app', 'access_token']);
export const getUserToken = (state, accountId) => {
return state.getIn(['auth', 'users', accountId, 'access_token']);
};
export const getAccessToken = state => {
const me = state.get('me');
return getUserToken(state, me);
};