feat: Set an account's password

This commit is contained in:
Susmitha Girumala committed 2020-09-14 18:50:55 -04:00
1 parent 3030d87abc
commit 24f0f82c9a
13 files changed
+203 -3

No files matched your search

+23
View File
@@ -9,4 +9,27 @@ 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 {object} options
* @param {object} options.adapterOptions
* @return {Promise}
*/
savePassword(options={ adapterOptions: {} }) {
const defaultAdapterOptions = {
method: 'set-password',
serializePassword: true
};
return this.save({
...options,
adapterOptions: {
...defaultAdapterOptions,
...options.adapterOptions
}
});
}
}