mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 04:46:34 +00:00
Allow resending email verification (#770)
This commit is contained in:
parent
0fd84a2f8d
commit
eeb949a081
@ -122,6 +122,9 @@
|
|||||||
on-tap='_handleVerifyEmail'
|
on-tap='_handleVerifyEmail'
|
||||||
progress='[[_requestInProgress]]'
|
progress='[[_requestInProgress]]'
|
||||||
>Verify Email</ha-progress-button>
|
>Verify Email</ha-progress-button>
|
||||||
|
<paper-button
|
||||||
|
on-tap='_handleResendVerifyEmail'
|
||||||
|
>Resend Verify Email</paper-button>
|
||||||
</div>
|
</div>
|
||||||
</paper-card>
|
</paper-card>
|
||||||
</template>
|
</template>
|
||||||
@ -233,7 +236,7 @@ class HaConfigCloudRegister extends
|
|||||||
confirmation_code: this._confirmationCode,
|
confirmation_code: this._confirmationCode,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
alert('Confirmation successful. You can now login.');
|
alert('Confirmation successful. You can now login.');
|
||||||
this.navigate('config/cloud/login');
|
this.navigate('config/cloud/login');
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
this._confirmationCode = '';
|
this._confirmationCode = '';
|
||||||
@ -242,6 +245,24 @@ class HaConfigCloudRegister extends
|
|||||||
this._requestInProgress = false;
|
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);
|
customElements.define(HaConfigCloudRegister.is, HaConfigCloudRegister);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user