Fix changing email address error handling

This commit is contained in:
Dane Everitt 2018-07-14 22:03:19 -07:00
parent eafc4408eb
commit a44b4c4426
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
3 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<div> <div id="change-password-container" :class>
<form method="post" v-on:submit.prevent="submitForm"> <form method="post" v-on:submit.prevent="submitForm">
<div class="content-box"> <div class="content-box">
<h2 class="mb-6 text-grey-darkest font-medium">{{ $t('dashboard.account.password.title') }}</h2> <h2 class="mb-6 text-grey-darkest font-medium">{{ $t('dashboard.account.password.title') }}</h2>

View File

@ -1,5 +1,5 @@
<template> <template>
<div :class> <div id="update-email-container" :class>
<form method="post" v-on:submit.prevent="submitForm"> <form method="post" v-on:submit.prevent="submitForm">
<div class="content-box"> <div class="content-box">
<h2 class="mb-6 text-grey-darkest font-medium">{{ $t('dashboard.account.email.title') }}</h2> <h2 class="mb-6 text-grey-darkest font-medium">{{ $t('dashboard.account.email.title') }}</h2>

View File

@ -71,11 +71,11 @@ export default {
.then(response => { .then(response => {
// If there is a 302 redirect or some other odd behavior (basically, response that isnt // If there is a 302 redirect or some other odd behavior (basically, response that isnt
// in JSON format) throw an error and don't try to continue with the login. // in JSON format) throw an error and don't try to continue with the login.
if (!(response.data instanceof Object)) { if (!(response.data instanceof Object) && response.status !== 201) {
return reject(new Error('An error was encountered while processing this request.')); return reject(new Error('An error was encountered while processing this request.'));
} }
commit('setEmail', response.data.email); commit('setEmail', email);
return resolve(); return resolve();
}) })
.catch(reject); .catch(reject);