DEPSTRCZ

Untitled

Nov 13th, 2022
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. <?php
  2.  
  3. use Pterodactyl\Http\Controllers\Auth;
  4.  
  5. /*
  6. |--------------------------------------------------------------------------
  7. | Authentication Routes
  8. |--------------------------------------------------------------------------
  9. |
  10. | Endpoint: /auth
  11. |
  12. */
  13.  
  14. // These routes are defined so that we can continue to reference them programatically.
  15. // They all route to the same controller function which passes off to React.
  16. Route::get('/login', [Auth\LoginController::class, 'index'])->name('auth.login');
  17. Route::get('/password', [Auth\LoginController::class, 'index'])->name('auth.forgot-password');
  18. Route::get('/password/reset/{token}', [Auth\LoginController::class, 'index'])->name('auth.reset');
  19.  
  20. // Apply a throttle to authentication action endpoints, in addition to the
  21. // recaptcha endpoints to slow down manual attack spammers even more. 🤷‍
  22. //
  23. // @see \Pterodactyl\Providers\RouteServiceProvider
  24. Route::middleware(['throttle:authentication'])->group(function () {
  25. // Login endpoints.
  26. Route::post('/login', [Auth\LoginController::class, 'login'])->middleware('recaptcha');
  27. Route::post('/login/checkpoint', Auth\LoginCheckpointController::class)->name('auth.login-checkpoint');
  28.  
  29. // Forgot password route. A post to this endpoint will trigger an
  30. // email to be sent containing a reset token.
  31. Route::post('/password', [Auth\ForgotPasswordController::class, 'sendResetLinkEmail'])
  32. ->name('auth.post.forgot-password')
  33. ->middleware('recaptcha');
  34. });
  35.  
  36. // Password reset routes. This endpoint is hit after going through
  37. // the forgot password routes to acquire a token (or after an account
  38. // is created).
  39. Route::post('/password/reset', Auth\ResetPasswordController::class)->name('auth.reset-password');
  40.  
  41. // Remove the guest middleware and apply the authenticated middleware to this endpoint
  42. // so it cannot be used unless you're already logged in.
  43. Route::post('/logout', [Auth\LoginController::class, 'logout'])
  44. ->withoutMiddleware('guest')
  45. ->middleware('auth')
  46. ->name('auth.logout');
  47.  
  48. // Catch any other combinations of routes and pass them off to the Vuejs component.
  49. Route::fallback([Auth\LoginController::class, 'index']);
  50.  
Advertisement
Add Comment
Please, Sign In to add comment