Skip to content

Commit

Permalink
Add JSON support when header accepts JSON (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
wudi authored and subfission committed Feb 27, 2017
1 parent c5732e0 commit b36714c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Subfission/Cas/Middleware/CASAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function handle($request, Closure $next)
// Store the user credentials in a Laravel managed session
session()->put('cas_user', $this->cas->user());
} else {
if ($request->ajax()) {
if ($request->ajax() || $request->wantsJson()) {
return response('Unauthorized.', 401);
}
$this->cas->authenticate();
Expand Down

0 comments on commit b36714c

Please sign in to comment.