Skip to content

Commit

Permalink
feat: revert add is_active in jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Dec 2, 2024
1 parent 812f0f4 commit 0fd12e2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion app/Controllers/Api/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 0 additions & 4 deletions app/Middleware/AuthMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()]);
Expand Down

0 comments on commit 0fd12e2

Please sign in to comment.