Fixes route registration.

This commit is contained in:
Italo Baeza Cabrera
2022-10-28 17:00:52 -03:00
parent 73e0e6c8ee
commit 93d12d12c9
2 changed files with 23 additions and 15 deletions

View File

@@ -4,14 +4,17 @@ use App\Http\Controllers\WebAuthn\WebAuthnLoginController;
use App\Http\Controllers\WebAuthn\WebAuthnRegisterController;
use Illuminate\Support\Facades\Route;
Route::middleware('web')->group(static function (): void {
Route::post('webauthn/register/options', [WebAuthnRegisterController::class, 'options'])
->name('webauthn.register.options');
Route::post('webauthn/register', [WebAuthnRegisterController::class, 'register'])
->name('webauthn.register');
Route::post('webauthn/login/options', [WebAuthnLoginController::class, 'options'])
->name('webauthn.login.options');
Route::post('webauthn/login', [WebAuthnLoginController::class, 'login'])
->name('webauthn.login');
Route::middleware('web')
->group(static function (): void {
Route::controller(WebAuthnRegisterController::class)
->group(static function (): void {
Route::post('webauthn/register/options', 'options')->name('webauthn.register.options');
Route::post('webauthn/register', 'register')->name('webauthn.register');
});
Route::controller(WebAuthnLoginController::class)
->group(static function (): void {
Route::post('webauthn/login/options', 'options')->name('webauthn.login.options');
Route::post('webauthn/login', 'login')->name('webauthn.login');
});
});

View File

@@ -32,13 +32,18 @@ class WebAuthn
public static function routes(): void
{
Route::middleware('web')
->controller(\App\Http\Controllers\WebAuthn\WebAuthnRegisterController::class)
->group(static function (): void {
Route::controller(\App\Http\Controllers\WebAuthn\WebAuthnRegisterController::class)
->group(static function (): void {
Route::post('webauthn/register/options', 'options')->name('webauthn.register.options');
Route::post('webauthn/register', 'register')->name('webauthn.register');
});
Route::controller(\App\Http\Controllers\WebAuthn\WebAuthnLoginController::class)
->group(static function (): void {
Route::post('webauthn/login/options', 'options')->name('webauthn.login.options');
Route::post('webauthn/login', 'login')->name('webauthn.login');
});
});
}
}