2016-01-21 03:39:02 +00:00
|
|
|
<?php
|
|
|
|
|
2017-11-18 21:09:58 +00:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Authentication Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /auth
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['middleware' => 'guest'], function () {
|
2018-04-08 20:46:32 +00:00
|
|
|
// These routes are defined so that we can continue to reference them programatically.
|
|
|
|
// They all route to the same controller function which passes off to Vuejs.
|
|
|
|
Route::get('/login', 'LoginController@index')->name('auth.login');
|
|
|
|
Route::get('/password', 'LoginController@index')->name('auth.forgot-password');
|
|
|
|
Route::get('/password/reset/{token}', 'LoginController@index')->name('auth.reset');
|
|
|
|
|
2021-10-23 19:17:16 +00:00
|
|
|
// Apply a throttle to authentication action endpoints, in addition to the
|
|
|
|
// recaptcha endpoints to slow down manual attack spammers even more. 🤷
|
|
|
|
//
|
|
|
|
// @see \Pterodactyl\Providers\RouteServiceProvider
|
|
|
|
Route::middleware(['throttle:authentication'])->group(function () {
|
|
|
|
// Login endpoints.
|
|
|
|
Route::post('/login', 'LoginController@login')->middleware('recaptcha');
|
|
|
|
Route::post('/login/checkpoint', 'LoginCheckpointController')->name('auth.login-checkpoint');
|
2018-04-07 21:17:51 +00:00
|
|
|
|
2021-10-23 19:17:16 +00:00
|
|
|
// Forgot password route. A post to this endpoint will trigger an
|
|
|
|
// email to be sent containing a reset token.
|
|
|
|
Route::post('/password', 'ForgotPasswordController@sendResetLinkEmail')
|
|
|
|
->name('auth.post.forgot-password')
|
|
|
|
->middleware('recaptcha');
|
|
|
|
});
|
2018-04-07 21:17:51 +00:00
|
|
|
|
|
|
|
// Password reset routes. This endpoint is hit after going through
|
|
|
|
// the forgot password routes to acquire a token (or after an account
|
|
|
|
// is created).
|
2020-08-02 04:08:35 +00:00
|
|
|
Route::post('/password/reset', 'ResetPasswordController')->name('auth.reset-password');
|
2018-04-08 21:00:52 +00:00
|
|
|
|
2022-05-14 18:54:24 +00:00
|
|
|
Route::namespace("\\Auth0\\Laravel\\Http\\Controller\\Stateful")->prefix('/providers/auth0')->group(function () {
|
|
|
|
Route::get('/login', 'Login')->name('auth.providers.auth0-login');
|
|
|
|
Route::get('/logout', 'Logout')->name('auth.providers.auth0-logout');
|
|
|
|
Route::get('/callback', 'Callback')->name('auth.providers.auth0-callback');
|
|
|
|
});
|
|
|
|
|
2018-04-08 21:00:52 +00:00
|
|
|
// Catch any other combinations of routes and pass them off to the Vuejs component.
|
|
|
|
Route::fallback('LoginController@index');
|
2017-11-18 21:09:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
2018-05-13 15:10:51 +00:00
|
|
|
| Routes Accessible only when logged in
|
2017-11-18 21:09:58 +00:00
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /auth
|
|
|
|
|
|
|
|
|
*/
|
2022-05-14 18:54:24 +00:00
|
|
|
Route::namespace("\\Auth0\\Laravel\\Http\\Controller\\Stateful")->group(function () {
|
|
|
|
Route::get('/logout', 'Logout');
|
|
|
|
});
|
|
|
|
//Route::post('/logout', 'LoginController@logout')->name('auth.logout')->middleware('auth', 'csrf');
|