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