Skip to content

Commit

Permalink
Device auth check update (#942)
Browse files Browse the repository at this point in the history
* Remove 8th check from device so all devices follow same pattern

* Bump app version
  • Loading branch information
matthew2564 authored Nov 11, 2022
1 parent fecde1b commit 92fee3d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="uk.gov.dvsa.drivingexaminerservices" version="4.6.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="uk.gov.dvsa.drivingexaminerservices" version="4.6.0.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>DES 4</name>
<description>A template ionic 5 application</description>
<content src="index.html" />
Expand Down
4 changes: 2 additions & 2 deletions ios/App/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.6.0.4</string>
<string>4.6.0.5</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>4.6.0.4</string>
<string>4.6.0.5</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
16 changes: 4 additions & 12 deletions src/app/providers/device-authentication/device-authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,17 @@ export class DeviceAuthenticationProvider {
};

private performBiometricVerification = async (): Promise<void> => {
const deviceType: string = this.deviceProvider.getDeviceType();
const isASAMEnabled: boolean = await this.deviceProvider.checkSingleAppMode();
// handle bug caused by accessing touch id while ASAM enabled in iPad 8th only
const shouldToggleASAM: boolean = isASAMEnabled && this.deviceProvider.is8thGenDevice(deviceType);
if (shouldToggleASAM) {
try {
await this.deviceProvider.disableSingleAppMode();
}

try {
await NativeBiometric.verifyIdentity({
reason: 'Please authenticate',
useFallback: true, // fallback to passcode if biometric authentication unavailable
});
} finally {
if (shouldToggleASAM) {
await this.loadingProvider.handleUILoading(true);
await this.deviceProvider.enableSingleAppMode();
await this.loadingProvider.handleUILoading(false);
}
await this.loadingProvider.handleUILoading(true);
await this.deviceProvider.enableSingleAppMode();
await this.loadingProvider.handleUILoading(false);
}
};
}

0 comments on commit 92fee3d

Please sign in to comment.