Files
threshold-ui/ui/admin/app/routes/account/change-password.js
T
2024-03-07 09:24:28 -08:00

32 lines
673 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
/**
* The change password flow is associated only with password-type auth methods.
*/
export default class AccountChangePasswordRoute extends Route {
// =services
@service store;
@service session;
@service intl;
@service router;
// =methods
/**
* Loads the account associated with the auth token.
* @return {?AccountModel}
*/
model() {
const account_id = this.session?.data?.authenticated?.account_id;
return this.store.findRecord('account', account_id);
}
}