@@ -89,10 +89,10 @@ In the `src-tauri/Info.ios.plist` file, add the following snippet:
8989<?xml version =" 1.0" encoding =" UTF-8" ?>
9090<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
9191<plist version =" 1.0" >
92- <dict >
93- <key >NSFaceIDUsageDescription</key >
94- <string >Authenticate with biometric</string >
95- </dict >
92+ <dict >
93+ <key >NSFaceIDUsageDescription</key >
94+ <string >Authenticate with biometric</string >
95+ </dict >
9696</plist >
9797```
9898
@@ -227,35 +227,39 @@ import { biometricCipher } from '@tauri-apps/plugin-biometric';
227227// Encrypts data
228228const encryptOptions = {
229229 // ... other options
230- dataToEncrypt: getOriginalData ()
230+ dataToEncrypt: getOriginalData (),
231231};
232232
233233try {
234- const encrypted = await biometricCipher (' Passwordless authentication' , encryptOptions);
234+ const encrypted = await biometricCipher (
235+ ' Passwordless authentication' ,
236+ encryptOptions
237+ );
235238 console .log (
236239 ' Hooray! Successfully encrypted data! We can now store it to decrypt later, when needed'
237240 );
238241} catch (err) {
239242 console .log (' Oh no! Authentication failed because ' + err .message );
240243}
241244
242-
243245// Decrypts data back to the original
244246const decryptOptions = {
245247 // ... other options
246248 dataToDecrypt: encrypted .data ,
247249};
248250
249251try {
250- const original = await biometricCipher (' Passwordless authentication' , decryptOptions);
252+ const original = await biometricCipher (
253+ ' Passwordless authentication' ,
254+ decryptOptions
255+ );
251256 console .log (
252257 ' Hooray! Successfully decrypted data after the user authenticated with their biometric method.'
253258 );
254259 const valid = originalData () == dataToDecrypt .data ;
255260} catch (err) {
256261 console .log (' Oh no! Authentication failed because ' + err .message );
257262}
258-
259263```
260264
261265</TabItem >
@@ -269,7 +273,7 @@ fn bio_cipher(app_handle: tauri::AppHandle, original_data: Option<String>) {
269273
270274 let encrypt_options = AuthOptions {
271275 // ... other options
272- data_to_encrypt : original_data . unwrap ()
276+ data_to_encrypt : original_data . unwrap ()
273277 };
274278
275279 // if the encryption was successful, the function returns Result::Ok(CipherResult)
@@ -285,7 +289,7 @@ fn bio_cipher(app_handle: tauri::AppHandle, original_data: Option<String>) {
285289
286290 let decrypt_options = AuthOptions {
287291 // ... other options
288- data_to_decrypt : encrypted . data
292+ data_to_decrypt : encrypted . data
289293 };
290294
291295 // if the encryption was successful, the function returns Result::Ok(CipherResult)
0 commit comments