forked from Jexactyl/Jexactyl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauth.php
56 lines (46 loc) · 2.55 KB
/
auth.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
use Pterodactyl\Http\Controllers\Auth;
/*
|--------------------------------------------------------------------------
| Authentication Routes
|--------------------------------------------------------------------------
|
| Endpoint: /auth
|
*/
// 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 React.
Route::get('/#', [Auth\LoginController::class, 'index'])->name('auth.login');
Route::get('/register', [Auth\LoginController::class, 'index'])->name('auth.register');
Route::get('/password', [Auth\LoginController::class, 'index'])->name('auth.forgot-password');
Route::get('/password/reset/{token}', [Auth\LoginController::class, 'index'])->name('auth.reset');
Route::post('/discord/#', [Auth\DiscordController::class, 'index'])->name('auth.discord.login');
Route::get('/discord/callback', [Auth\DiscordController::class, 'callback'])->name('auth.discord.callback');
// 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('/#', [Auth\LoginController::class, 'login'])->middleware('recaptcha');
Route::post('/#/checkpoint', Auth\LoginCheckpointController::class)->name('auth.login-checkpoint');
// Registration endpoints.
Route::post('/register', [Auth\RegisterController::class, 'register'])->middleware('recaptcha');
// Forgot password route. A post to this endpoint will trigger an
// email to be sent containing a reset token.
Route::post('/password', [Auth\ForgotPasswordController::class, 'sendResetLinkEmail'])
->name('auth.post.forgot-password')
->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', Auth\ResetPasswordController::class)->name('auth.reset-password');
// 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.
Route::fallback([Auth\LoginController::class, 'index']);