mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-01-06 06:15:51 +00:00
preparing for next release
This commit is contained in:
@@ -199,19 +199,13 @@ export default class AuthLoginController extends Controller {
|
||||
* @return {Promise<Transition>}
|
||||
* @memberof AuthLoginController
|
||||
*/
|
||||
sendUserForEmailVerification(email) {
|
||||
return this.fetch.post('auth/create-verification-session', { email, send: true }).then(({ token }) => {
|
||||
@action sendUserForEmailVerification(email) {
|
||||
return this.fetch.post('auth/create-verification-session', { email, send: true }).then(({ token, session }) => {
|
||||
return this.session.store.persist({ email }).then(() => {
|
||||
this.notifications.warning(this.intl.t('auth.login.unverified-notification'));
|
||||
return this.router
|
||||
.transitionTo('auth.verification', {
|
||||
queryParams: {
|
||||
token,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
this.reset('error');
|
||||
});
|
||||
return this.router.transitionTo('auth.verification', { queryParams: { token, hello: session } }).then(() => {
|
||||
this.reset('error');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -150,6 +150,21 @@ export default class AuthVerificationController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates input on the first render
|
||||
*
|
||||
* @param {HTMLElement} el
|
||||
* @memberof AuthVerificationController
|
||||
*/
|
||||
@action validateInitInput(el) {
|
||||
const value = el.value;
|
||||
if (value.length > 5) {
|
||||
this.isReadyToSubmit = true;
|
||||
} else {
|
||||
this.isReadyToSubmit = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits to verify code.
|
||||
*
|
||||
|
||||
@@ -11,6 +11,12 @@ export default class AuthVerificationRoute extends Route {
|
||||
refreshModel: false,
|
||||
replace: true,
|
||||
},
|
||||
code: {
|
||||
refreshModel: false,
|
||||
},
|
||||
hello: {
|
||||
refreshModel: false,
|
||||
},
|
||||
};
|
||||
|
||||
beforeModel(transition) {
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class OnboardVerifyEmailRoute extends Route {}
|
||||
export default class OnboardVerifyEmailRoute extends Route {
|
||||
queryParams = {
|
||||
code: {
|
||||
refreshModel: false,
|
||||
},
|
||||
hello: {
|
||||
refreshModel: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
|
||||
<form class="mt-8 space-y-6" {{on "submit" this.verifyCode}}>
|
||||
<InputGroup @type="tel" @name={{t "auth.verification.verification-input-label"}} @value={{this.code}} @helpText={{t "auth.verification.verification-code-text"}} @inputClass="input-lg" {{on "input" this.validateInput}} />
|
||||
<InputGroup @type="tel" @name={{t "auth.verification.verification-input-label"}} @value={{this.code}} @helpText={{t "auth.verification.verification-code-text"}} @inputClass="input-lg" {{on "input" this.validateInput}} {{did-insert this.validateInitInput}} />
|
||||
|
||||
<div class="flex flex-row items-center space-x-4">
|
||||
<Button @icon="check" @iconPrefix="fas" @buttonType="submit" @type="primary" @size="lg" @text="Verify & Continue" @isLoading={{this.isLoading}} @disabled={{this.isNotReadyToSubmit}} @onClick={{this.verifyCode}} />
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
|
||||
<form class="mt-8 space-y-6" {{on "submit" this.verifyCode}}>
|
||||
<InputGroup @type="tel" @name={{t "onboard.verify-email.verification-input-label"}} @value={{this.code}} @helpText={{t "onboard.verify-email.verification-code-text"}} @inputClass="input-lg" {{on "input" this.validateInput}} />
|
||||
<InputGroup @type="tel" @name={{t "onboard.verify-email.verification-input-label"}} @value={{this.code}} @helpText={{t "onboard.verify-email.verification-code-text"}} @inputClass="input-lg" {{on "input" this.validateInput}} {{did-insert this.validateInitInput}} />
|
||||
|
||||
<div class="flex flex-row items-center space-x-4">
|
||||
<Button @icon="check" @iconPrefix="fas" @buttonType="submit" @type="primary" @size="lg" @text="Verify & Continue" @isLoading={{this.isLoading}} @disabled={{this.isNotReadyToSubmit}} @onClick={{this.verifyCode}} />
|
||||
|
||||
Reference in New Issue
Block a user