Add controllers and packages for security keys

This commit is contained in:
Matthew Penner 2022-10-24 09:44:16 -06:00
parent f8ec8b4d5a
commit 06f692e649
No known key found for this signature in database
29 changed files with 2398 additions and 383 deletions

View file

@ -1,5 +1,6 @@
<?php
use Illuminate\Support\Facades\Route;
use Pterodactyl\Http\Controllers\Auth;
/*
@ -11,7 +12,7 @@ use Pterodactyl\Http\Controllers\Auth;
|
*/
// These routes are defined so that we can continue to reference them programatically.
// These routes are defined so that we can continue to reference them programmatically.
// They all route to the same controller function which passes off to React.
Route::get('/login', [Auth\LoginController::class, 'index'])->name('auth.login');
Route::get('/password', [Auth\LoginController::class, 'index'])->name('auth.forgot-password');
@ -24,7 +25,8 @@ Route::get('/password/reset/{token}', [Auth\LoginController::class, 'index'])->n
Route::middleware(['throttle:authentication'])->group(function () {
// Login endpoints.
Route::post('/login', [Auth\LoginController::class, 'login'])->middleware('recaptcha');
Route::post('/login/checkpoint', Auth\LoginCheckpointController::class)->name('auth.login-checkpoint');
Route::post('/login/checkpoint', [Auth\LoginCheckpointController::class, 'token'])->name('auth.checkpoint');
Route::post('/login/checkpoint/key', [Auth\LoginCheckpointController::class, 'key'])->name('auth.checkpoint.key');
// Forgot password route. A post to this endpoint will trigger an
// email to be sent containing a reset token.
@ -38,12 +40,12 @@ Route::middleware(['throttle:authentication'])->group(function () {
// is created).
Route::post('/password/reset', Auth\ResetPasswordController::class)->name('auth.reset-password');
// Remove the guest middleware and apply the authenticated middleware to this endpoint
// Remove the guest middleware and apply the authenticated middleware to this endpoint,
// so it cannot be used unless you're already logged in.
Route::post('/logout', [Auth\LoginController::class, 'logout'])
->withoutMiddleware('guest')
->middleware('auth')
->name('auth.logout');
// Catch any other combinations of routes and pass them off to the Vuejs component.
// Catch any other combinations of routes and pass them off to the React frontend.
Route::fallback([Auth\LoginController::class, 'index']);