File size: 799 Bytes
2d8be8f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | <script>
import { authenticate } from "@tauri-apps/plugin-biometric";
export let onMessage;
let allowDeviceCredential = true;
function auth() {
authenticate("Tauri API wants to show it is awesome :)", {
allowDeviceCredential,
cancelTitle: "Cancel request",
fallbackTitle: "Trying the fallback option",
title: "Tauri API Auth",
subtitle: "Please authenticate :)",
confirmationRequired: false,
maxAttemps: 1,
})
.then(onMessage)
.catch(onMessage);
}
</script>
<div>
<input
type="checkbox"
id="dllowDeviceCredential"
bind:checked={allowDeviceCredential}
/>
<label for="allowDeviceCredentiale">Allow device credential</label>
</div>
<button class="btn" id="cli-matches" on:click={auth}> Authenticate </button>
|