PHP code example of scriptoshi / livewire-webauthn
1. Go to this page and download the library: Download scriptoshi/livewire-webauthn library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
scriptoshi / livewire-webauthn example snippets
use Scriptoshi\LivewireWebauthn\Traits\WebAuthnAuthenticatable;
class User extends Authenticatable
{
use WebAuthnAuthenticatable;
// ...
}
use Scriptoshi\LivewireWebauthn\Http\Middleware\WebAuthn;
// Intercept login attempts and handle WebAuthn if needed
Route::post('/login', [AuthenticatedSessionController::class, 'store'])
->middleware(['guest', WebAuthn::class])
->name('login');