Fast Login for Laravel is a plugin to allow your users to login with FaceID/TouchID:
This package supports various physical authentication devices:
Allow your users to register physical authentication devices (FaceID or TouchID on iPhones & Macs, fingerprint on Android, Hello on Windows and USB keys) to skip entering their login credentials.
The package takes care of (almost) everything you'll need to get this working in your app quickly. The server-side involves updating the User
model with a CanFastLogin
trait, and the document outlines the frontend usage you'll need to implement FaceID/TouchID logins.
Here's an example of the frontend code used to login a user with Touch/FaceID from the project's readme:
1import Cookies from 'js-cookie' 2import { useLogin } from '@web-auth/webauthn-helper' 3 4const onClick = () => { 5 const token = Cookies.get('XSRF-TOKEN') 6 7 useLogin({ 8 actionUrl: route('fastlogin.login'), 9 optionsUrl: route('fastlogin.login.details'),10 actionHeader: {11 'x-xsrf-token': token12 },13 }, {14 'x-xsrf-token': token15 })().then(() => {16 // the user has been logged in17 18 window.location.reload()19 })20}
You can learn more about this package, get full installation instructions, and view the source code on GitHub.
0 comments:
Post a Comment
Thanks