fix: Remove password attribute from account model
This commit is contained in:
5 files changed
+126
-9
No files matched your search
@@ -9,4 +9,29 @@ export default class AccountModel extends GeneratedAccountModel {
|
||||
*/
|
||||
@fragment('fragment-account-attributes', { defaultValue: {} }) attributes;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Save account password via the `set-password` method.
|
||||
* See serializer and adapter for more information.
|
||||
* @param {string} password
|
||||
* @param {object} options
|
||||
* @param {object} options.adapterOptions
|
||||
* @return {Promise}
|
||||
*/
|
||||
savePassword(password, options={ adapterOptions: {} }) {
|
||||
const defaultAdapterOptions = {
|
||||
method: 'set-password',
|
||||
serializeWithNewPassword: true,
|
||||
password
|
||||
};
|
||||
return this.save({
|
||||
...options,
|
||||
adapterOptions: {
|
||||
...defaultAdapterOptions,
|
||||
...options.adapterOptions
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,4 @@ export default class FragmentAccountAttributesModel extends Fragment {
|
||||
description: 'The account login name'
|
||||
}) login_name;
|
||||
|
||||
@attr('string', {
|
||||
description: 'The account password'
|
||||
}) password;
|
||||
}
|
||||
Reference in new issue
Block a user