diff --git a/app/Controllers/Api/AuthController.php b/app/Controllers/Api/AuthController.php index 976d5b9..1a4bdef 100644 --- a/app/Controllers/Api/AuthController.php +++ b/app/Controllers/Api/AuthController.php @@ -31,7 +31,7 @@ public function login(AuthRequest $request, JsonResponse $json): JsonResponse 'exp' => $time + (60 * 60), 'iss' => base_url(), 'is_admin' => true, - ...Auth::user()->only(['id', 'name', 'email', 'is_active'])->toArray() + ...Auth::user()->only(['id', 'name', 'email'])->toArray() ], env('JWT_KEY'), env('JWT_ALGO', 'HS256') diff --git a/app/Middleware/AuthMiddleware.php b/app/Middleware/AuthMiddleware.php index 23f01e0..00d7799 100644 --- a/app/Middleware/AuthMiddleware.php +++ b/app/Middleware/AuthMiddleware.php @@ -29,10 +29,6 @@ public function handle(Request $request, Closure $next) new Key(env('JWT_KEY'), env('JWT_ALGO', 'HS256')) )); - if (!$user->is_active) { - throw new Exception('user not active.'); - } - Auth::login($user); } catch (Exception $e) { return (new JsonResponse)->errorBadRequest([$e->getMessage()]);