mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
usercp token management
This commit is contained in:
@@ -13,6 +13,7 @@ use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Laravel\Passport\Passport;
|
||||
use Nexus\Database\NexusDB;
|
||||
use Nexus\Nexus;
|
||||
use Filament\Facades\Filament;
|
||||
|
||||
@@ -37,6 +38,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
global $plugin;
|
||||
$plugin->start();
|
||||
NexusDB::customModel();
|
||||
DB::connection(config('database.default'))->enableQueryLog();
|
||||
$forceScheme = strtolower(env('FORCE_SCHEME'));
|
||||
if (env('APP_ENV') == "production" && in_array($forceScheme, ['https', 'http'])) {
|
||||
|
||||
@@ -9,7 +9,6 @@ use App\Models\Category;
|
||||
use App\Models\Codec;
|
||||
use App\Models\Icon;
|
||||
use App\Models\Media;
|
||||
use App\Models\OauthClient;
|
||||
use App\Models\Plugin;
|
||||
use App\Models\Processing;
|
||||
use App\Models\SearchBox;
|
||||
@@ -22,7 +21,6 @@ use App\Policies\CodecPolicy;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Laravel\Passport\Passport;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -55,11 +53,6 @@ class AuthServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
// $this->registerPolicies();
|
||||
if (class_exists(Passport::class)) {
|
||||
Passport::useClientModel(OauthClient::class);
|
||||
}
|
||||
|
||||
Auth::viaRequest('nexus-cookie', function (Request $request) {
|
||||
return $this->getUserByCookie($request->cookie());
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
$this->configureRateLimiting();
|
||||
|
||||
$this->routes(function () {
|
||||
Route::prefix('api')
|
||||
Route::prefix('api/v1')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
|
||||
Reference in New Issue
Block a user