fix: 🐛 clear token on normalization (#1351)
* fix: 🐛 clear token on normalization
This commit is contained in:
1 parent
0cba914045
commit
3fc22b4aa3
3 files changed
+86
-42
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import ApplicationSerializer from './application';
|
||||
import { copy } from 'ember-copy';
|
||||
|
||||
export default class CredentialStoreSerializer extends ApplicationSerializer {
|
||||
/**
|
||||
@@ -38,4 +39,12 @@ export default class CredentialStoreSerializer extends ApplicationSerializer {
|
||||
delete serialized.attributes;
|
||||
return serialized;
|
||||
}
|
||||
|
||||
normalize(typeClass, hash, ...rest) {
|
||||
const normalizedHash = copy(hash, true);
|
||||
const normalized = super.normalize(typeClass, normalizedHash, ...rest);
|
||||
// Remove secret fields as we don't track them after being created/updated
|
||||
normalized.data.attributes.token = '';
|
||||
return normalized;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user