mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 20:36:35 +00:00
Allow resending email verification (#770)
This commit is contained in:
parent
0fd84a2f8d
commit
eeb949a081
@ -122,6 +122,9 @@
|
||||
on-tap='_handleVerifyEmail'
|
||||
progress='[[_requestInProgress]]'
|
||||
>Verify Email</ha-progress-button>
|
||||
<paper-button
|
||||
on-tap='_handleResendVerifyEmail'
|
||||
>Resend Verify Email</paper-button>
|
||||
</div>
|
||||
</paper-card>
|
||||
</template>
|
||||
@ -233,7 +236,7 @@ class HaConfigCloudRegister extends
|
||||
confirmation_code: this._confirmationCode,
|
||||
}).then(() => {
|
||||
// eslint-disable-next-line
|
||||
alert('Confirmation successful. You can now login.');
|
||||
alert('Confirmation successful. You can now login.');
|
||||
this.navigate('config/cloud/login');
|
||||
}, (err) => {
|
||||
this._confirmationCode = '';
|
||||
@ -242,6 +245,24 @@ class HaConfigCloudRegister extends
|
||||
this._requestInProgress = false;
|
||||
});
|
||||
}
|
||||
|
||||
_handleResendVerifyEmail() {
|
||||
if (!this.email) {
|
||||
this._error = 'Email is required.';
|
||||
}
|
||||
|
||||
if (this._error) return;
|
||||
|
||||
this.hass.callApi('post', 'cloud/resend_confirm', {
|
||||
email: this.email,
|
||||
}).then(() => {
|
||||
// eslint-disable-next-line
|
||||
alert('Email resend.');
|
||||
}, (err) => {
|
||||
this._error = err && err.body && err.body.message ?
|
||||
err.body.message : 'Unknown error';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define(HaConfigCloudRegister.is, HaConfigCloudRegister);
|
||||
|
Loading…
x
Reference in New Issue
Block a user