Files
threshold-ui/addons/api/addon/serializers/credential.js
T

17 lines
556 B
JavaScript
Raw Normal View History

2022-07-20 12:34:18 -07:00
import ApplicationSerializer from './application';
import { copy } from 'ember-copy';
export default class CredentialSerializer extends ApplicationSerializer {
serialize() {
let serialized = super.serialize(...arguments);
delete serialized['attributes']['password_hmac'];
return serialized;
}
normalize(typeClass, hash, ...rest) {
const normalizedHash = copy(hash, true);
const normalized = super.normalize(typeClass, normalizedHash, ...rest);
normalized['data']['attributes']['password'] = '';
return normalized;
}
}