Adds accountVerifyEmailAddress action (calls rest-endpoint)
@@ -10,6 +10,7 @@ import {
registerAccount,
transferPrivateAccount,
acceptTermsOfService,
+ confirmRegistration,
login,
logout,
parseCredentials,
@@ -368,6 +369,24 @@ export function accountAcceptTermsOfService() {
};
}
+export function accountVerifyEmailAddress(verificationToken) {
+ return dispatch => {
+ dispatch({ type: actionTypes.account.verifyEmailAddressStarted });
+ confirmRegistration(verificationToken)
+ .then(() => {
+ dispatch({ type: actionTypes.account.verifyEmailAddressSuccess });
+ })
+ .catch(error =>
+ dispatch({
+ type: actionTypes.account.verifyEmailAddressFailed,
+ payload: {
+ emailVerificationError: Immutable.fromJS(error.jsonResponse),
+ },
+ })
+ );
+ };
+}
+
export function reconnect() {
return async (dispatch, getState) => {
dispatch({ type: actionTypes.reconnect.start });
