misc_pterodactyl-panel/routes/auth.php

47 lines
1.9 KiB
PHP
Raw Normal View History

2016-01-21 03:39:02 +00:00
<?php
2020-10-04 20:25:58 +00:00
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Authentication Routes
|--------------------------------------------------------------------------
|
| Endpoint: /auth
|
*/
Route::group(['middleware' => 'guest'], function () {
2021-01-13 17:03:27 +00:00
// 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.
2018-04-08 20:46:32 +00:00
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');
// Login endpoints.
Route::post('/login', 'LoginController@login')->middleware('recaptcha');
Route::post('/login/checkpoint', 'LoginCheckpointController')->name('auth.login-checkpoint');
Route::post('/login/checkpoint/key', 'WebauthnController@auth');
// Forgot password route. A post to this endpoint will trigger an
// email to be sent containing a reset token.
2018-04-08 20:46:32 +00:00
Route::post('/password', 'ForgotPasswordController@sendResetLinkEmail')->middleware('recaptcha');
// Password reset routes. This endpoint is hit after going through
// the forgot password routes to acquire a token (or after an account
// is created).
Route::post('/password/reset', 'ResetPasswordController')->name('auth.reset-password');
2018-04-08 21:00:52 +00:00
2021-01-13 17:03:27 +00:00
// Catch any other combinations of routes and pass them off to the React component.
2018-04-08 21:00:52 +00:00
Route::fallback('LoginController@index');
});
/*
|--------------------------------------------------------------------------
2018-05-13 15:10:51 +00:00
| Routes Accessible only when logged in
|--------------------------------------------------------------------------
|
| Endpoint: /auth
|
*/
Route::get('/logout', 'LoginController@logout')->name('auth.logout')->middleware('auth');