Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
iGroza committed Jun 20, 2024
1 parent 555b695 commit 5d319a8
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions src/contexts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ class App extends AsyncEventEmitter {

let shouldSkipAuth = false;
try {
await this.getPassword();
const pass = await this.getPassword();
Alert.alert('your PIN', pass);
} catch (err) {
if (err === 'password_migration_not_possible') {
shouldSkipAuth = true;
Expand Down Expand Up @@ -561,23 +562,26 @@ class App extends AsyncEventEmitter {
}

async auth() {
this.resetAuth();
const close = showModal(ModalType.pin);
if (SecurePinUtils.isPinChangedWithFail()) {
try {
await SecurePinUtils.rollbackPin();
showModal(ModalType.pinError);
} catch (e) {
const details = (e as Error)?.message || e?.toString();
showModal(ModalType.pinError, {details});
Logger.error(e, 'app.auth rollback pin failed');
}
}
await Promise.race([this.makeBiometryAuth(), this.makePinAuth()]);

if (this.authenticated) {
close();
}
this.user.successEnter();
this.authenticated = true;
return;
// this.resetAuth();
// const close = showModal(ModalType.pin);
// if (SecurePinUtils.isPinChangedWithFail()) {
// try {
// await SecurePinUtils.rollbackPin();
// showModal(ModalType.pinError);
// } catch (e) {
// const details = (e as Error)?.message || e?.toString();
// showModal(ModalType.pinError, {details});
// Logger.error(e, 'app.auth rollback pin failed');
// }
// }
// await Promise.race([this.makeBiometryAuth(), this.makePinAuth()]);

// if (this.authenticated) {
// close();
// }
}

async makeBiometryAuth() {
Expand Down

0 comments on commit 5d319a8

Please sign in to comment.