Socket
Socket
Sign inDemoInstall

expo-local-authentication

Package Overview
Dependencies
Maintainers
28
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-local-authentication - npm Package Compare versions

Comparing version 11.1.1 to 12.0.0

android/src/main/java/expo/modules/localauthentication/LocalAuthenticationModule.kt

2

build/ExpoLocalAuthentication.d.ts

@@ -1,2 +0,2 @@

declare const _default: import("@unimodules/core").ProxyNativeModule;
declare const _default: import("expo-modules-core").ProxyNativeModule;
export default _default;

@@ -1,3 +0,3 @@

import { NativeModulesProxy } from '@unimodules/core';
import { NativeModulesProxy } from 'expo-modules-core';
export default NativeModulesProxy.ExpoLocalAuthentication;
//# sourceMappingURL=ExpoLocalAuthentication.js.map
import { LocalAuthenticationOptions, AuthenticationType, LocalAuthenticationResult, SecurityLevel } from './LocalAuthentication.types';
export { LocalAuthenticationOptions, AuthenticationType, LocalAuthenticationResult, SecurityLevel };
/**
* Determine whether a face or fingerprint scanner is available on the device.
* @return Returns a promise which fulfils with a `boolean` value indicating whether a face or
* fingerprint scanner is available on this device.
*/
export declare function hasHardwareAsync(): Promise<boolean>;
/**
* Determine what kinds of authentications are available on the device.
* @return Returns a promise which fulfils to an array containing [`AuthenticationType`s](#authenticationtype).
*
* Devices can support multiple authentication methods- i.e. `[1,2]` means the device supports both
* fingerprint and facial recognition. If none are supported, this method returns an empty array.
*/
export declare function supportedAuthenticationTypesAsync(): Promise<AuthenticationType[]>;
/**
* Determine whether the device has saved fingerprints or facial data to use for authentication.
* @return Returns a promise which fulfils to `boolean` value indicating whether the device has
* saved fingerprints or facial data for authentication.
*/
export declare function isEnrolledAsync(): Promise<boolean>;
/**
* Determine what kind of authentication is enrolled on the device.
* @return Returns a promise which fulfils with [`SecurityLevel`](#securitylevel).
* > **Note:** On Android devices prior to M, `SECRET` can be returned if only the SIM lock has been
* enrolled, which is not the method that [`authenticateAsync`](#localauthenticationauthenticateasyncoptions)
* prompts.
*/
export declare function getEnrolledLevelAsync(): Promise<SecurityLevel>;
/**
* Attempts to authenticate via Fingerprint/TouchID (or FaceID if available on the device).
* > **Note:** Apple requires apps which use FaceID to provide a description of why they use this API.
* If you try to use FaceID on an iPhone with FaceID without providing `infoPlist.NSFaceIDUsageDescription`
* in `app.json`, the module will authenticate using device passcode. For more information about
* usage descriptions on iOS, see [Deploying to App Stores](/distribution/app-stores#system-permissions-dialogs-on-ios).
* @param options
* @return Returns a promise which fulfils with [`LocalAuthenticationResult`](#localauthenticationresult).
*/
export declare function authenticateAsync(options?: LocalAuthenticationOptions): Promise<LocalAuthenticationResult>;
/**
* **(Android Only)** Cancels authentication flow.
*/
export declare function cancelAuthenticate(): Promise<void>;

@@ -1,2 +0,2 @@

import { UnavailabilityError } from '@unimodules/core';
import { UnavailabilityError } from 'expo-modules-core';
import invariant from 'invariant';

@@ -6,2 +6,8 @@ import ExpoLocalAuthentication from './ExpoLocalAuthentication';

export { AuthenticationType, SecurityLevel };
// @needsAudit
/**
* Determine whether a face or fingerprint scanner is available on the device.
* @return Returns a promise which fulfils with a `boolean` value indicating whether a face or
* fingerprint scanner is available on this device.
*/
export async function hasHardwareAsync() {

@@ -13,2 +19,10 @@ if (!ExpoLocalAuthentication.hasHardwareAsync) {

}
// @needsAudit
/**
* Determine what kinds of authentications are available on the device.
* @return Returns a promise which fulfils to an array containing [`AuthenticationType`s](#authenticationtype).
*
* Devices can support multiple authentication methods- i.e. `[1,2]` means the device supports both
* fingerprint and facial recognition. If none are supported, this method returns an empty array.
*/
export async function supportedAuthenticationTypesAsync() {

@@ -20,2 +34,8 @@ if (!ExpoLocalAuthentication.supportedAuthenticationTypesAsync) {

}
// @needsAudit
/**
* Determine whether the device has saved fingerprints or facial data to use for authentication.
* @return Returns a promise which fulfils to `boolean` value indicating whether the device has
* saved fingerprints or facial data for authentication.
*/
export async function isEnrolledAsync() {

@@ -27,2 +47,10 @@ if (!ExpoLocalAuthentication.isEnrolledAsync) {

}
// @needsAudit
/**
* Determine what kind of authentication is enrolled on the device.
* @return Returns a promise which fulfils with [`SecurityLevel`](#securitylevel).
* > **Note:** On Android devices prior to M, `SECRET` can be returned if only the SIM lock has been
* enrolled, which is not the method that [`authenticateAsync`](#localauthenticationauthenticateasyncoptions)
* prompts.
*/
export async function getEnrolledLevelAsync() {

@@ -34,2 +62,12 @@ if (!ExpoLocalAuthentication.getEnrolledLevelAsync) {

}
// @needsAudit
/**
* Attempts to authenticate via Fingerprint/TouchID (or FaceID if available on the device).
* > **Note:** Apple requires apps which use FaceID to provide a description of why they use this API.
* If you try to use FaceID on an iPhone with FaceID without providing `infoPlist.NSFaceIDUsageDescription`
* in `app.json`, the module will authenticate using device passcode. For more information about
* usage descriptions on iOS, see [Deploying to App Stores](/distribution/app-stores#system-permissions-dialogs-on-ios).
* @param options
* @return Returns a promise which fulfils with [`LocalAuthenticationResult`](#localauthenticationresult).
*/
export async function authenticateAsync(options = {}) {

@@ -49,2 +87,6 @@ if (!ExpoLocalAuthentication.authenticateAsync) {

}
// @needsAudit
/**
* **(Android Only)** Cancels authentication flow.
*/
export async function cancelAuthenticate() {

@@ -51,0 +93,0 @@ if (!ExpoLocalAuthentication.cancelAuthenticate) {

@@ -6,18 +6,56 @@ export declare type LocalAuthenticationResult = {

error: string;
warning?: string;
};
export declare enum AuthenticationType {
/**
* Indicates fingerprint support.
*/
FINGERPRINT = 1,
/**
* Indicates facial recognition support.
*/
FACIAL_RECOGNITION = 2,
/**
* __Android-only.__ Indicates iris recognition support.
*/
IRIS = 3
}
export declare enum SecurityLevel {
/**
* Indicates no enrolled authentication.
*/
NONE = 0,
/**
* Indicates non-biometric authentication (e.g. PIN, Pattern).
*/
SECRET = 1,
/**
* Indicates biometric authentication.
*/
BIOMETRIC = 2
}
export declare type LocalAuthenticationOptions = {
/**
* A message that is shown alongside the TouchID or FaceID prompt.
*/
promptMessage?: string;
/**
* Allows to customize the default `Cancel` label shown.
*/
cancelLabel?: string;
/**
* After several failed attempts the system will fallback to the device passcode. This setting
* allows you to disable this option and instead handle the fallback yourself. This can be
* preferable in certain custom authentication workflows. This behaviour maps to using the iOS
* [LAPolicyDeviceOwnerAuthenticationWithBiometrics](https://developer.apple.com/documentation/localauthentication/lapolicy/lapolicydeviceownerauthenticationwithbiometrics?language=objc)
* policy rather than the [LAPolicyDeviceOwnerAuthentication](https://developer.apple.com/documentation/localauthentication/lapolicy/lapolicydeviceownerauthentication?language=objc)
* policy. Defaults to `false`.
*/
disableDeviceFallback?: boolean;
/**
* **iOS only.** Allows to customize the default `Use Passcode` label shown after several failed
* authentication attempts. Setting this option to an empty string disables this button from
* showing in the prompt.
*/
fallbackLabel?: string;
};

@@ -0,14 +1,33 @@

// @needsAudit
export var AuthenticationType;
(function (AuthenticationType) {
/**
* Indicates fingerprint support.
*/
AuthenticationType[AuthenticationType["FINGERPRINT"] = 1] = "FINGERPRINT";
/**
* Indicates facial recognition support.
*/
AuthenticationType[AuthenticationType["FACIAL_RECOGNITION"] = 2] = "FACIAL_RECOGNITION";
// Android only
/**
* __Android-only.__ Indicates iris recognition support.
*/
AuthenticationType[AuthenticationType["IRIS"] = 3] = "IRIS";
})(AuthenticationType || (AuthenticationType = {}));
// @needsAudit
export var SecurityLevel;
(function (SecurityLevel) {
/**
* Indicates no enrolled authentication.
*/
SecurityLevel[SecurityLevel["NONE"] = 0] = "NONE";
/**
* Indicates non-biometric authentication (e.g. PIN, Pattern).
*/
SecurityLevel[SecurityLevel["SECRET"] = 1] = "SECRET";
/**
* Indicates biometric authentication.
*/
SecurityLevel[SecurityLevel["BIOMETRIC"] = 2] = "BIOMETRIC";
})(SecurityLevel || (SecurityLevel = {}));
//# sourceMappingURL=LocalAuthentication.types.js.map

@@ -13,6 +13,19 @@ # Changelog

## 11.1.1 — 2021-06-24
## 12.0.0 — 2021-09-28
_This version does not introduce any user-facing changes._
### 🛠 Breaking changes
- Dropped support for iOS 11.0 ([#14383](https://github.com/expo/expo/pull/14383) by [@cruzach](https://github.com/cruzach))
### 🐛 Bug fixes
- Added missing definition on type LocalAuthenticationResult. ([#13636](https://github.com/expo/expo/pull/13636) by [@mstach60161](https://github.com/mstach60161))
- Fixed detection of the available authentication types on some Samsung devices on Android. ([#14300](https://github.com/expo/expo/pull/14300) by [@beaur](https://github.com/beaur))
- Fix building errors from use_frameworks! in Podfile. ([#14523](https://github.com/expo/expo/pull/14523) by [@kudo](https://github.com/kudo))
### 💡 Others
- Rewrite module from Java to Kotlin. ([#13582](https://github.com/expo/expo/pull/13582) by [@mstach60161](https://github.com/mstach60161))
- Updated `@expo/config-plugins` ([#14443](https://github.com/expo/expo/pull/14443) by [@EvanBacon](https://github.com/EvanBacon))
## 11.1.0 — 2021-06-16

@@ -19,0 +32,0 @@

{
"name": "expo-local-authentication",
"version": "11.1.1",
"version": "12.0.0",
"description": "Provides an API for FaceID and TouchID (iOS) or the Fingerprint API (Android) to authenticate the user with a face or fingerprint scan.",

@@ -36,3 +36,3 @@ "main": "build/LocalAuthentication.js",

"license": "MIT",
"homepage": "https://docs.expo.io/versions/latest/sdk/local-authentication/",
"homepage": "https://docs.expo.dev/versions/latest/sdk/local-authentication/",
"jest": {

@@ -42,3 +42,3 @@ "preset": "expo-module-scripts"

"dependencies": {
"@expo/config-plugins": "^3.0.0",
"@expo/config-plugins": "^3.1.0",
"invariant": "^2.2.4"

@@ -49,3 +49,3 @@ },

},
"gitHead": "4fc9d282ff7ab2fa9040b775aeca7c30f5167b17"
"gitHead": "1fffde73411ee7a642b98f1506a8de921805d52b"
}

@@ -1,3 +0,3 @@

import { NativeModulesProxy } from '@unimodules/core';
import { NativeModulesProxy } from 'expo-modules-core';
export default NativeModulesProxy.ExpoLocalAuthentication;

@@ -1,2 +0,2 @@

import { UnavailabilityError } from '@unimodules/core';
import { UnavailabilityError } from 'expo-modules-core';
import invariant from 'invariant';

@@ -14,2 +14,8 @@

// @needsAudit
/**
* Determine whether a face or fingerprint scanner is available on the device.
* @return Returns a promise which fulfils with a `boolean` value indicating whether a face or
* fingerprint scanner is available on this device.
*/
export async function hasHardwareAsync(): Promise<boolean> {

@@ -22,2 +28,10 @@ if (!ExpoLocalAuthentication.hasHardwareAsync) {

// @needsAudit
/**
* Determine what kinds of authentications are available on the device.
* @return Returns a promise which fulfils to an array containing [`AuthenticationType`s](#authenticationtype).
*
* Devices can support multiple authentication methods- i.e. `[1,2]` means the device supports both
* fingerprint and facial recognition. If none are supported, this method returns an empty array.
*/
export async function supportedAuthenticationTypesAsync(): Promise<AuthenticationType[]> {

@@ -30,2 +44,8 @@ if (!ExpoLocalAuthentication.supportedAuthenticationTypesAsync) {

// @needsAudit
/**
* Determine whether the device has saved fingerprints or facial data to use for authentication.
* @return Returns a promise which fulfils to `boolean` value indicating whether the device has
* saved fingerprints or facial data for authentication.
*/
export async function isEnrolledAsync(): Promise<boolean> {

@@ -38,2 +58,10 @@ if (!ExpoLocalAuthentication.isEnrolledAsync) {

// @needsAudit
/**
* Determine what kind of authentication is enrolled on the device.
* @return Returns a promise which fulfils with [`SecurityLevel`](#securitylevel).
* > **Note:** On Android devices prior to M, `SECRET` can be returned if only the SIM lock has been
* enrolled, which is not the method that [`authenticateAsync`](#localauthenticationauthenticateasyncoptions)
* prompts.
*/
export async function getEnrolledLevelAsync(): Promise<SecurityLevel> {

@@ -46,2 +74,12 @@ if (!ExpoLocalAuthentication.getEnrolledLevelAsync) {

// @needsAudit
/**
* Attempts to authenticate via Fingerprint/TouchID (or FaceID if available on the device).
* > **Note:** Apple requires apps which use FaceID to provide a description of why they use this API.
* If you try to use FaceID on an iPhone with FaceID without providing `infoPlist.NSFaceIDUsageDescription`
* in `app.json`, the module will authenticate using device passcode. For more information about
* usage descriptions on iOS, see [Deploying to App Stores](/distribution/app-stores#system-permissions-dialogs-on-ios).
* @param options
* @return Returns a promise which fulfils with [`LocalAuthenticationResult`](#localauthenticationresult).
*/
export async function authenticateAsync(

@@ -70,2 +108,6 @@ options: LocalAuthenticationOptions = {}

// @needsAudit
/**
* **(Android Only)** Cancels authentication flow.
*/
export async function cancelAuthenticate(): Promise<void> {

@@ -72,0 +114,0 @@ if (!ExpoLocalAuthentication.cancelAuthenticate) {

@@ -1,22 +0,62 @@

export type LocalAuthenticationResult = { success: true } | { success: false; error: string };
export type LocalAuthenticationResult =
| { success: true }
| { success: false; error: string; warning?: string };
// @needsAudit
export enum AuthenticationType {
/**
* Indicates fingerprint support.
*/
FINGERPRINT = 1,
/**
* Indicates facial recognition support.
*/
FACIAL_RECOGNITION = 2,
// Android only
/**
* __Android-only.__ Indicates iris recognition support.
*/
IRIS = 3,
}
// @needsAudit
export enum SecurityLevel {
/**
* Indicates no enrolled authentication.
*/
NONE = 0,
/**
* Indicates non-biometric authentication (e.g. PIN, Pattern).
*/
SECRET = 1,
/**
* Indicates biometric authentication.
*/
BIOMETRIC = 2,
}
// @needsAudit
export type LocalAuthenticationOptions = {
/**
* A message that is shown alongside the TouchID or FaceID prompt.
*/
promptMessage?: string;
/**
* Allows to customize the default `Cancel` label shown.
*/
cancelLabel?: string;
/**
* After several failed attempts the system will fallback to the device passcode. This setting
* allows you to disable this option and instead handle the fallback yourself. This can be
* preferable in certain custom authentication workflows. This behaviour maps to using the iOS
* [LAPolicyDeviceOwnerAuthenticationWithBiometrics](https://developer.apple.com/documentation/localauthentication/lapolicy/lapolicydeviceownerauthenticationwithbiometrics?language=objc)
* policy rather than the [LAPolicyDeviceOwnerAuthentication](https://developer.apple.com/documentation/localauthentication/lapolicy/lapolicydeviceownerauthentication?language=objc)
* policy. Defaults to `false`.
*/
disableDeviceFallback?: boolean;
// iOS only
/**
* **iOS only.** Allows to customize the default `Use Passcode` label shown after several failed
* authentication attempts. Setting this option to an empty string disables this button from
* showing in the prompt.
*/
fallbackLabel?: string;
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc