Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

App is not wiped anymore when you don't have biometrical hardware #256

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/screens/AppLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,11 @@ class AppLoaderScreen extends React.Component {

const { restrictions } = this.props;

BiometricAuth.hasHardware()
.then(hasHardware => {
if (!hasHardware && restrictions !== []) {
return this.reinitData();
}
})
.catch(() => {});
BiometricAuth.hasHardware().catch(() => {
if (restrictions.length > 0) {
return this.reinitData();
}
});

if (data.type === PayUTC.CAS_AUTH_TYPE) {
return this.checkCasConnection(data.ticket, data.login, data.password);
Expand Down
4 changes: 2 additions & 2 deletions src/services/BiometricAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const defaultSecurity = [TRANSFER, REFILL, BADGE_LOCKING];
export const advancedSecurity = [TRANSFER, REFILL, BADGE_LOCKING, APP_OPENING];

export default class BiometricAuth extends React.PureComponent {
static async hasHardware() {
static hasHardware() {
return LocalAuthentication.hasHardwareAsync();
}

Expand All @@ -47,7 +47,7 @@ export default class BiometricAuth extends React.PureComponent {
const hasHardware = await BiometricAuth.hasHardware();

// If the Security Mode has not been properly disabled
if (!hasHardware && restrictions !== []) {
if (!hasHardware && restrictions.length > 0) {
PayUTC.forget().payload.then(() => {
navigation.navigate('Auth');

Expand Down