Save biometry column
This commit is contained in:
parent
9f3b932189
commit
bb09aa09c7
|
@ -57,16 +57,26 @@ export const localAuthenticate = async(server) => {
|
||||||
// Make sure splash screen has been hidden
|
// Make sure splash screen has been hidden
|
||||||
RNBootSplash.hide();
|
RNBootSplash.hide();
|
||||||
|
|
||||||
const isEnrolled = await LocalAuthentication.isEnrolledAsync();
|
// if biometry is enabled on the app
|
||||||
const isSupported = await LocalAuthentication.supportedAuthenticationTypesAsync();
|
if (serverRecord?.biometry) {
|
||||||
|
const isEnrolled = await LocalAuthentication.isEnrolledAsync();
|
||||||
|
const isSupported = await LocalAuthentication.supportedAuthenticationTypesAsync();
|
||||||
|
|
||||||
// if biometry is enabled and enrolled on OS
|
// if biometry is enabled and enrolled on OS
|
||||||
if (isEnrolled && isSupported) {
|
if (isEnrolled && isSupported?.length) {
|
||||||
// opens biometry prompt
|
// opens biometry prompt
|
||||||
const authResult = await LocalAuthentication.authenticateAsync({ disableDeviceFallback: true });
|
let authResult;
|
||||||
if (authResult?.success) {
|
try {
|
||||||
await resetAttempts();
|
authResult = await LocalAuthentication.authenticateAsync({ disableDeviceFallback: true });
|
||||||
await saveLastLocalAuthenticationSession(server, serverRecord);
|
} catch (e) {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
if (authResult?.success) {
|
||||||
|
await resetAttempts();
|
||||||
|
await saveLastLocalAuthenticationSession(server, serverRecord);
|
||||||
|
} else {
|
||||||
|
await localPasscode();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
await localPasscode();
|
await localPasscode();
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ class ScreenLockConfigView extends React.Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
autoLock: this.serverRecord?.autoLock,
|
autoLock: this.serverRecord?.autoLock,
|
||||||
autoLockTime: this.serverRecord?.autoLockTime || 1800,
|
autoLockTime: this.serverRecord?.autoLockTime || 1800,
|
||||||
biometry: this.serverRecord?.biometry || true
|
biometry: this.serverRecord.biometry === null ? true : this.serverRecord.biometry
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
@ -100,7 +100,7 @@ class ScreenLockConfigView extends React.Component {
|
||||||
await this.serverRecord?.update((record) => {
|
await this.serverRecord?.update((record) => {
|
||||||
record.autoLock = autoLock;
|
record.autoLock = autoLock;
|
||||||
record.autoLockTime = autoLockTime;
|
record.autoLockTime = autoLockTime;
|
||||||
record.biometry = biometry;
|
record.biometry = biometry === null ? true : biometry;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue