@symbiote-native/local-auth 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -67
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ src/angular/ @symbiote-native/local-auth/angular — export * from '../core'
|
|
|
65
65
|
```tsx
|
|
66
66
|
// React
|
|
67
67
|
import { useEffect, useState } from 'react';
|
|
68
|
-
import { Platform
|
|
68
|
+
import { Platform } from '@symbiote-native/react';
|
|
69
69
|
import {
|
|
70
70
|
authenticateAsync,
|
|
71
71
|
cancelAuthenticate,
|
|
@@ -92,26 +92,26 @@ function LocalAuthScreen() {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
return (
|
|
95
|
-
<
|
|
96
|
-
<
|
|
95
|
+
<view>
|
|
96
|
+
<text>
|
|
97
97
|
{hasHardware && isEnrolled
|
|
98
98
|
? 'Ready to authenticate'
|
|
99
99
|
: 'No biometrics enrolled'}
|
|
100
|
-
</
|
|
101
|
-
<
|
|
102
|
-
<
|
|
103
|
-
</
|
|
100
|
+
</text>
|
|
101
|
+
<pressable onPress={handleAuthenticate}>
|
|
102
|
+
<text>Authenticate</text>
|
|
103
|
+
</pressable>
|
|
104
104
|
{Platform.OS === 'android' && (
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
</
|
|
105
|
+
<pressable onPress={() => cancelAuthenticate()}>
|
|
106
|
+
<text>Cancel</text>
|
|
107
|
+
</pressable>
|
|
108
108
|
)}
|
|
109
109
|
{authResult && (
|
|
110
|
-
<
|
|
110
|
+
<text>
|
|
111
111
|
{authResult.success ? 'Success' : `Failed: ${authResult.error}`}
|
|
112
|
-
</
|
|
112
|
+
</text>
|
|
113
113
|
)}
|
|
114
|
-
</
|
|
114
|
+
</view>
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
117
|
```
|
|
@@ -120,7 +120,7 @@ function LocalAuthScreen() {
|
|
|
120
120
|
<!-- Vue -->
|
|
121
121
|
<script setup lang="ts">
|
|
122
122
|
import { onMounted, ref } from 'vue';
|
|
123
|
-
import { Platform
|
|
123
|
+
import { Platform } from '@symbiote-native/vue';
|
|
124
124
|
import {
|
|
125
125
|
authenticateAsync,
|
|
126
126
|
cancelAuthenticate,
|
|
@@ -146,29 +146,29 @@ function handleAuthenticate(): void {
|
|
|
146
146
|
</script>
|
|
147
147
|
|
|
148
148
|
<template>
|
|
149
|
-
<
|
|
150
|
-
<
|
|
149
|
+
<view>
|
|
150
|
+
<text>{{
|
|
151
151
|
hasHardware && isEnrolled
|
|
152
152
|
? 'Ready to authenticate'
|
|
153
153
|
: 'No biometrics enrolled'
|
|
154
|
-
}}</
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
</
|
|
158
|
-
<
|
|
159
|
-
<
|
|
160
|
-
</
|
|
161
|
-
<
|
|
154
|
+
}}</text>
|
|
155
|
+
<pressable @press="handleAuthenticate">
|
|
156
|
+
<text>Authenticate</text>
|
|
157
|
+
</pressable>
|
|
158
|
+
<pressable v-if="Platform.OS === 'android'" @press="cancelAuthenticate">
|
|
159
|
+
<text>Cancel</text>
|
|
160
|
+
</pressable>
|
|
161
|
+
<text v-if="authResult">{{
|
|
162
162
|
authResult.success ? 'Success' : `Failed: ${authResult.error}`
|
|
163
|
-
}}</
|
|
164
|
-
</
|
|
163
|
+
}}</text>
|
|
164
|
+
</view>
|
|
165
165
|
</template>
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
```svelte
|
|
169
169
|
<!-- Svelte -->
|
|
170
170
|
<script lang="ts">
|
|
171
|
-
import { Platform
|
|
171
|
+
import { Platform } from '@symbiote-native/svelte';
|
|
172
172
|
import {
|
|
173
173
|
authenticateAsync,
|
|
174
174
|
cancelAuthenticate,
|
|
@@ -193,28 +193,31 @@ function handleAuthenticate(): void {
|
|
|
193
193
|
}
|
|
194
194
|
</script>
|
|
195
195
|
|
|
196
|
-
<
|
|
197
|
-
<
|
|
198
|
-
{hasHardware && isEnrolled
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
196
|
+
<view>
|
|
197
|
+
<text>
|
|
198
|
+
{hasHardware && isEnrolled
|
|
199
|
+
? 'Ready to authenticate'
|
|
200
|
+
: 'No biometrics enrolled'}
|
|
201
|
+
</text>
|
|
202
|
+
<pressable onPress={handleAuthenticate}>
|
|
203
|
+
<text>Authenticate</text>
|
|
204
|
+
</pressable>
|
|
203
205
|
{#if Platform.OS === 'android'}
|
|
204
|
-
<
|
|
205
|
-
<
|
|
206
|
-
</
|
|
206
|
+
<pressable onPress={() => cancelAuthenticate()}>
|
|
207
|
+
<text>Cancel</text>
|
|
208
|
+
</pressable>
|
|
207
209
|
{/if}
|
|
208
210
|
{#if authResult}
|
|
209
|
-
<
|
|
211
|
+
<text>{authResult.success ? 'Success' : `Failed: ${authResult.error}`}</text
|
|
212
|
+
>
|
|
210
213
|
{/if}
|
|
211
|
-
</
|
|
214
|
+
</view>
|
|
212
215
|
```
|
|
213
216
|
|
|
214
217
|
```tsx
|
|
215
218
|
// Solid
|
|
216
219
|
import { Show, createSignal, onMount } from 'solid-js';
|
|
217
|
-
import { Platform
|
|
220
|
+
import { Platform } from '@symbiote-native/solid';
|
|
218
221
|
import {
|
|
219
222
|
authenticateAsync,
|
|
220
223
|
cancelAuthenticate,
|
|
@@ -241,28 +244,26 @@ function LocalAuthScreen() {
|
|
|
241
244
|
};
|
|
242
245
|
|
|
243
246
|
return (
|
|
244
|
-
<
|
|
245
|
-
<
|
|
247
|
+
<view>
|
|
248
|
+
<text>
|
|
246
249
|
{hasHardware() && isEnrolled()
|
|
247
250
|
? 'Ready to authenticate'
|
|
248
251
|
: 'No biometrics enrolled'}
|
|
249
|
-
</
|
|
250
|
-
<
|
|
251
|
-
<
|
|
252
|
-
</
|
|
252
|
+
</text>
|
|
253
|
+
<pressable onPress={handleAuthenticate}>
|
|
254
|
+
<text>Authenticate</text>
|
|
255
|
+
</pressable>
|
|
253
256
|
{Platform.OS === 'android' && (
|
|
254
|
-
<
|
|
255
|
-
<
|
|
256
|
-
</
|
|
257
|
+
<pressable onPress={() => cancelAuthenticate()}>
|
|
258
|
+
<text>Cancel</text>
|
|
259
|
+
</pressable>
|
|
257
260
|
)}
|
|
258
261
|
<Show when={authResult()} keyed>
|
|
259
262
|
{result => (
|
|
260
|
-
<
|
|
261
|
-
{result.success ? 'Success' : `Failed: ${result.error}`}
|
|
262
|
-
</Text>
|
|
263
|
+
<text>{result.success ? 'Success' : `Failed: ${result.error}`}</text>
|
|
263
264
|
)}
|
|
264
265
|
</Show>
|
|
265
|
-
</
|
|
266
|
+
</view>
|
|
266
267
|
);
|
|
267
268
|
}
|
|
268
269
|
```
|
|
@@ -270,7 +271,7 @@ function LocalAuthScreen() {
|
|
|
270
271
|
```ts
|
|
271
272
|
// Angular
|
|
272
273
|
import { Component, signal } from '@angular/core';
|
|
273
|
-
import { Platform,
|
|
274
|
+
import { Platform, SYMBIOTE_ELEMENTS } from '@symbiote-native/angular';
|
|
274
275
|
import {
|
|
275
276
|
authenticateAsync,
|
|
276
277
|
cancelAuthenticate,
|
|
@@ -281,28 +282,28 @@ import type { ILocalAuthenticationResult } from '@symbiote-native/local-auth/ang
|
|
|
281
282
|
|
|
282
283
|
@Component({
|
|
283
284
|
standalone: true,
|
|
284
|
-
imports: [
|
|
285
|
+
imports: [SYMBIOTE_ELEMENTS],
|
|
285
286
|
template: `
|
|
286
|
-
<
|
|
287
|
-
<
|
|
287
|
+
<view>
|
|
288
|
+
<text>{{
|
|
288
289
|
hasHardware() && isEnrolled()
|
|
289
290
|
? 'Ready to authenticate'
|
|
290
291
|
: 'No biometrics enrolled'
|
|
291
|
-
}}</
|
|
292
|
-
<
|
|
293
|
-
<
|
|
294
|
-
</
|
|
292
|
+
}}</text>
|
|
293
|
+
<pressable (press)="handleAuthenticate()">
|
|
294
|
+
<text>Authenticate</text>
|
|
295
|
+
</pressable>
|
|
295
296
|
@if (Platform.OS === 'android') {
|
|
296
|
-
<
|
|
297
|
-
<
|
|
298
|
-
</
|
|
297
|
+
<pressable (press)="handleCancel()">
|
|
298
|
+
<text>Cancel</text>
|
|
299
|
+
</pressable>
|
|
299
300
|
}
|
|
300
301
|
@if (authResult(); as result) {
|
|
301
|
-
<
|
|
302
|
+
<text>{{
|
|
302
303
|
result.success ? 'Success' : 'Failed: ' + result.error
|
|
303
|
-
}}</
|
|
304
|
+
}}</text>
|
|
304
305
|
}
|
|
305
|
-
</
|
|
306
|
+
</view>
|
|
306
307
|
`,
|
|
307
308
|
})
|
|
308
309
|
export class LocalAuthScreen {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/local-auth",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "expo-local-authentication wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. FaceID/TouchID on iOS, the Fingerprint/Biometric API on Android.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
"solid-js": ">=1.9.0",
|
|
82
82
|
"svelte": ">=5.56.0",
|
|
83
83
|
"vue": ">=3.5.0",
|
|
84
|
-
"@symbiote-native/angular": "^
|
|
85
|
-
"@symbiote-native/engine": "^0.
|
|
86
|
-
"@symbiote-native/react": "^
|
|
87
|
-
"@symbiote-native/solid": "^
|
|
88
|
-
"@symbiote-native/svelte": "^
|
|
89
|
-
"@symbiote-native/vue": "^
|
|
84
|
+
"@symbiote-native/angular": "^2.0.0",
|
|
85
|
+
"@symbiote-native/engine": "^0.5.0",
|
|
86
|
+
"@symbiote-native/react": "^2.0.0",
|
|
87
|
+
"@symbiote-native/solid": "^2.0.0",
|
|
88
|
+
"@symbiote-native/svelte": "^2.0.0",
|
|
89
|
+
"@symbiote-native/vue": "^2.0.0"
|
|
90
90
|
},
|
|
91
91
|
"peerDependenciesMeta": {
|
|
92
92
|
"@symbiote-native/angular": {
|
|
@@ -135,13 +135,13 @@
|
|
|
135
135
|
"solid-js": "^1.9.14",
|
|
136
136
|
"svelte": "^5.56.0",
|
|
137
137
|
"typescript": "~6.0.0",
|
|
138
|
-
"@symbiote-native/angular": "
|
|
139
|
-
"@symbiote-native/engine": "0.
|
|
140
|
-
"@symbiote-native/react": "
|
|
141
|
-
"@symbiote-native/solid": "
|
|
142
|
-
"@symbiote-native/svelte": "
|
|
138
|
+
"@symbiote-native/angular": "2.0.0",
|
|
139
|
+
"@symbiote-native/engine": "0.5.0",
|
|
140
|
+
"@symbiote-native/react": "2.0.0",
|
|
141
|
+
"@symbiote-native/solid": "2.0.0",
|
|
142
|
+
"@symbiote-native/svelte": "2.0.0",
|
|
143
143
|
"@symbiote-native/test-utils": "0.3.0",
|
|
144
|
-
"@symbiote-native/vue": "
|
|
144
|
+
"@symbiote-native/vue": "2.0.0"
|
|
145
145
|
},
|
|
146
146
|
"scripts": {
|
|
147
147
|
"typecheck": "tsc --build",
|