mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-01-08 07:16:49 +00:00
26 lines
775 B
JavaScript
26 lines
775 B
JavaScript
import Route from '@ember/routing/route';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default class AuthResetPasswordRoute extends Route {
|
|
@service store;
|
|
@service fetch;
|
|
@service router;
|
|
@service notifications;
|
|
@service intl;
|
|
|
|
async model({ id }) {
|
|
return this.fetch.get('auth/validate-verification', { id });
|
|
}
|
|
|
|
async setupController(controller, model) {
|
|
super.setupController(...arguments);
|
|
if (model.is_valid === false) {
|
|
this.notifications.warning(this.intl.t('auth.reset-password.invalid-verification-code'));
|
|
return this.router.transitionTo('auth');
|
|
}
|
|
|
|
// set brand to controller
|
|
controller.brand = await this.store.findRecord('brand', 1);
|
|
}
|
|
}
|