mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-22 00:03:46 +02:00
Change authentication method for API.
This commit is contained in:
@@ -10,25 +10,7 @@ class APIRoutes
|
||||
|
||||
public function map(Router $router) {
|
||||
|
||||
app('Dingo\Api\Auth\Auth')->extend('jwt', function ($app) {
|
||||
return new \Dingo\Api\Auth\Provider\JWT($app['Tymon\JWTAuth\JWTAuth']);
|
||||
});
|
||||
|
||||
$api = app('Dingo\Api\Routing\Router');
|
||||
|
||||
$api->version('v1', function ($api) {
|
||||
$api->post('auth/login', [
|
||||
'as' => 'api.auth.login',
|
||||
'uses' => 'Pterodactyl\Http\Controllers\API\AuthController@postLogin'
|
||||
]);
|
||||
|
||||
$api->post('auth/validate', [
|
||||
'middleware' => 'api.auth',
|
||||
'as' => 'api.auth.validate',
|
||||
'uses' => 'Pterodactyl\Http\Controllers\API\AuthController@postValidate'
|
||||
]);
|
||||
});
|
||||
|
||||
$api->version('v1', ['middleware' => 'api.auth'], function ($api) {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user