Skip to content

Commit 1c2b00d

Browse files
doc
1 parent c89a840 commit 1c2b00d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,35 @@ Want a nicer guide than these raw code samples? Read [Nic Raboy's blog post abou
6262
)
6363
```
6464

65+
## Security++
66+
Since iOS9 it's possible to check whether or not the list of enrolled fingerprints changed since
67+
the last time you checked it. It's recommended you add this check so you can counter hacker attacks
68+
to your app. See [this article](https://godpraksis.no/2016/03/fingerprint-trojan/) for more details.
69+
70+
So instead of checking the fingerprint after `available` add another check.
71+
In case `didFingerprintDatabaseChange` returns `true` you probably want to re-authenticate your user
72+
before accepting valid fingerprints again.
73+
74+
```js
75+
touchid.available().then(
76+
function(avail) {
77+
if (avail) {
78+
touchid.didFingerprintDatabaseChange().then(
79+
function(changed) {
80+
if (changed) {
81+
// re-auth the user by asking for his credentials before allowing a fingerprint scan again
82+
} else {
83+
// call the fingerprint scanner
84+
}
85+
}
86+
);
87+
}
88+
}
89+
)
90+
```
91+
6592
## Changelog
93+
- 2.1.0 Added `didFingerprintDatabaseChange` for enhanced security.
6694
- 2.0.0 Added `verifyFingerprintWithCustomFallback`, `verifyFingerprint` now falls back to the passcode.
6795
- 1.2.0 You can now use the built-in passcode interface as fallback.
6896
- 1.1.1 Added TypeScript definitions.

0 commit comments

Comments
 (0)