mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-01 12:08:06 +02:00
feat(mobile): add biometric plugin (#829)
* chore: update deps, make mobile script paths relative * feat(biometric): setup plugin folder * feat: implement iOS * add api * android * fix plugin name * also check empty info.plist entry * add example * fix android * supress * lint * better explanation * add partners & contributed by * change ext * license headers * update vite * add covector setup * tauri/dox removed * add example * docs --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
import Clipboard from "./views/Clipboard.svelte";
|
||||
import WebRTC from "./views/WebRTC.svelte";
|
||||
import Scanner from "./views/Scanner.svelte";
|
||||
import Biometric from "./views/Biometric.svelte";
|
||||
|
||||
import { onMount } from "svelte";
|
||||
import { ask } from "@tauri-apps/plugin-dialog";
|
||||
@@ -113,6 +114,11 @@
|
||||
component: Nfc,
|
||||
icon: "i-ph-nfc",
|
||||
},
|
||||
isMobile && {
|
||||
label: "Biometric",
|
||||
component: Biometric,
|
||||
icon: "i-ph-scan",
|
||||
},
|
||||
];
|
||||
|
||||
let selected = views[0];
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user