make sure email is verified before setting auth token header

This commit is contained in:
Sean Yesmunt 2020-06-09 12:37:34 -04:00
parent 8068279b5e
commit 36044b9e03

View file

@ -162,7 +162,7 @@ const sharedStateCb = ({ dispatch, getState }) => {
const populateAuthTokenHeader = () => {
return next => action => {
if (action.type === LBRYINC_ACTIONS.AUTHENTICATION_SUCCESS) {
if (action.type === LBRYINC_ACTIONS.USER_FETCH_SUCCESS && action.data.user.has_verified_email === true) {
const authToken = getAuthToken();
Lbry.setApiHeader(X_LBRY_AUTH_TOKEN, authToken);
}