File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -304,6 +304,34 @@ export class EntryStorage {
304304 delete _data [ hash ] ;
305305 continue ;
306306 }
307+ // remove unnecessary fields
308+ if (
309+ ! ( _data [ hash ] . type === OTPType [ OTPType . hotp ] ) &&
310+ ! ( _data [ hash ] . type === OTPType [ OTPType . hhex ] )
311+ ) {
312+ delete _data [ hash ] . counter ;
313+ }
314+
315+ if ( _data [ hash ] . period === 30 ) {
316+ delete _data [ hash ] . period ;
317+ }
318+
319+ if ( ! _data [ hash ] . issuer ) {
320+ delete _data [ hash ] . issuer ;
321+ }
322+
323+ if ( ! _data [ hash ] . account ) {
324+ delete _data [ hash ] . account ;
325+ }
326+
327+ if ( _data [ hash ] . digits === 6 ) {
328+ delete _data [ hash ] . digits ;
329+ }
330+
331+ if ( _data [ hash ] . algorithm === OTPAlgorithm [ OTPAlgorithm . SHA1 ] ) {
332+ delete _data [ hash ] . algorithm ;
333+ }
334+
307335 if ( ! encrypted ) {
308336 // decrypt the data to export
309337 if ( _data [ hash ] . encrypted ) {
You can’t perform that action at this time.
0 commit comments