Skip to content

Native Node.js module for working with macOS Local Authentication (eg. TouchID)

License

Notifications You must be signed in to change notification settings

emilbayes/macos-touchid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macos-touchid

Build Status

Native module for working with macOS Local Authentication (eg. TouchID)

Usage

var touchid = require('macos-touchid')

if (touchid.canAuthenticate() === false) {
  throw new Error('No authentication method available')
}

touchid.authenticate('authenticate you', function (err, didAuthenticate) {
  if (err) throw err

  console.log(didAuthenticate ? `You're in!` : 'You will be terminated')
})

API

const bool = touchid.canAuthenticate()

Check if authentication is available

touchid.authenticate(reason, cb(err, bool))

Attempt to authenticate

Install

npm install macos-touchid

License

ISC

About

Native Node.js module for working with macOS Local Authentication (eg. TouchID)

Resources

License

Stars

Watchers

Forks

Packages

No packages published