Skip to content

Commit

Permalink
Merge pull request #578 from Peergos/fix/mfa-offline-login
Browse files Browse the repository at this point in the history
add remove method for offline account cache used by MFA
  • Loading branch information
ianopolous authored Apr 30, 2024
2 parents 2e1dc51 + e2869e9 commit 3f96887
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions vendor/priors/gwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ var accountCache = {
});
};
this.setLoginData = setLoginDataIntoCacheProm;
this.remove = removeLoginDataFromCacheProm;
this.getEntryData = getEntryDataFromCacheProm;
}
};
Expand All @@ -1184,6 +1185,21 @@ function setLoginDataIntoCacheProm(key, entryPoints) {
return future;
}

function removeLoginDataFromCacheProm(key) {
let future = peergos.shared.util.Futures.incomplete();
if (!this.isCachingEnabled) {
future.complete(true);
} else {
let that = this;
delIDBKV(key, this.cacheAccountStore).then(() => {
future.complete(true);
}).catch(err => {
future.complete(true);
});
}
return future;
}

// public native CompletableFuture<byte[]> getEntryData(String key);
function getEntryDataFromCacheProm(key) {
let that = this;
Expand Down

0 comments on commit 3f96887

Please sign in to comment.