trim verification token
This commit is contained in:
parent
56aa4d2255
commit
9c9d685be6
1 changed files with 10 additions and 10 deletions
|
@ -85,7 +85,7 @@ export function doUserEmailNew(email) {
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.USER_EMAIL_NEW_FAILURE,
|
type: types.USER_EMAIL_NEW_FAILURE,
|
||||||
data: { error: error.message },
|
data: { error },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -103,19 +103,13 @@ export function doUserEmailDecline() {
|
||||||
export function doUserEmailVerify(verificationToken) {
|
export function doUserEmailVerify(verificationToken) {
|
||||||
return function(dispatch, getState) {
|
return function(dispatch, getState) {
|
||||||
const email = selectEmailToVerify(getState());
|
const email = selectEmailToVerify(getState());
|
||||||
|
verificationToken = verificationToken.toString().trim();
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.USER_EMAIL_VERIFY_STARTED,
|
type: types.USER_EMAIL_VERIFY_STARTED,
|
||||||
code: verificationToken,
|
code: verificationToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
const failure = error => {
|
|
||||||
dispatch({
|
|
||||||
type: types.USER_EMAIL_VERIFY_FAILURE,
|
|
||||||
data: { error: error.message },
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
lbryio
|
lbryio
|
||||||
.call(
|
.call(
|
||||||
"user_email",
|
"user_email",
|
||||||
|
@ -131,8 +125,14 @@ export function doUserEmailVerify(verificationToken) {
|
||||||
});
|
});
|
||||||
dispatch(doUserFetch());
|
dispatch(doUserFetch());
|
||||||
} else {
|
} else {
|
||||||
failure(new Error("Your email is still not verified.")); //shouldn't happen?
|
throw new Error("Your email is still not verified."); //shouldn't happen
|
||||||
}
|
}
|
||||||
}, failure);
|
})
|
||||||
|
.catch(error => {
|
||||||
|
dispatch({
|
||||||
|
type: types.USER_EMAIL_VERIFY_FAILURE,
|
||||||
|
data: { error },
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue