Rewrites controller registration to something more understandable.

This commit is contained in:
Italo Baeza Cabrera
2022-10-28 16:35:43 -03:00
parent f784f601d4
commit ed68058bd8

View File

@@ -31,20 +31,14 @@ class WebAuthn
*/
public static function routes(): void
{
Route::middleware('web')->group(static function (): void {
Route::post(
'webauthn/register/options', [\App\Http\Controllers\WebAuthn\WebAuthnRegisterController::class, 'options'
])->name('webauthn.register.options');
Route::post(
'webauthn/register', [\App\Http\Controllers\WebAuthn\WebAuthnRegisterController::class, 'register'
])->name('webauthn.register');
Route::middleware('web')
->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::post(
'webauthn/login/options', [\App\Http\Controllers\WebAuthn\WebAuthnLoginController::class, 'options'
])->name('webauthn.login.options');
Route::post(
'webauthn/login', [\App\Http\Controllers\WebAuthn\WebAuthnLoginController::class, 'login'
])->name('webauthn.login');
Route::post('webauthn/login/options', 'options')->name('webauthn.login.options');
Route::post('webauthn/login', 'login')->name('webauthn.login');
});
}
}