Add new views for account verification and creation

This commit is contained in:
abe33 2018-12-12 16:17:23 +01:00
parent a5bb001516
commit f04e64175b
No known key found for this signature in database
GPG Key ID: C864D42B6A53E85B

View File

@ -158,6 +158,7 @@ module.exports = class KiteInstall {
new CheckEmail({
name: 'check-email',
failureStep: 'input-email',
view: accountVerificationView,
}),
new BranchStep([
{
@ -170,7 +171,7 @@ module.exports = class KiteInstall {
}),
}, {
match: (data) => !data.account.exists,
step: new CreateAccount({name: 'create-account'}),
step: new CreateAccount({name: 'create-account', view: accountCreationView}),
},
], {
name: 'account-switch',
@ -221,6 +222,13 @@ function inputEmailView (state) {
</form>`;
}
function accountVerificationView (state) {
return `Please wait, we're currently verifying whether an account exist or not for this email.`;
}
function accountCreationView (state) {
return `Please wait, we're currently creating your account.`;
}
function loginView(state) {
return `
<p>It seems like you already have a Kite account. Sign in with your login info.</p>