This commit is contained in:
Eugene Pankov
2021-06-13 21:38:34 +02:00
parent 33479a17dd
commit 2b2865e5f6

View File

@@ -3,9 +3,9 @@ import { promisify } from 'util'
import { Injectable, NgZone } from '@angular/core' import { Injectable, NgZone } from '@angular/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { AsyncSubject, Subject, Observable } from 'rxjs' import { AsyncSubject, Subject, Observable } from 'rxjs'
import { wrapPromise } from 'terminus-core'
import { UnlockVaultModalComponent } from '../components/unlockVaultModal.component' import { UnlockVaultModalComponent } from '../components/unlockVaultModal.component'
import { NotificationsService } from '../services/notifications.service' import { NotificationsService } from '../services/notifications.service'
import { wrapPromise } from 'utils'
const PBKDF_ITERATIONS = 100000 const PBKDF_ITERATIONS = 100000
const PBKDF_DIGEST = 'sha512' const PBKDF_DIGEST = 'sha512'
@@ -121,7 +121,7 @@ export class VaultService {
passphrase = await this.getPassphrase() passphrase = await this.getPassphrase()
} }
try { try {
return wrapPromise(this.zone, decryptVault(storage, passphrase)) return await wrapPromise(this.zone, decryptVault(storage, passphrase))
} catch (e) { } catch (e) {
_rememberedPassphrase = null _rememberedPassphrase = null
if (e.toString().includes('BAD_DECRYPT')) { if (e.toString().includes('BAD_DECRYPT')) {