mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
fix: make API respond to JSON requests
This commit is contained in:
parent
ac53b6dd00
commit
27ab35a1ae
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ class Authenticate
|
|||
public function handle(Request $request, Closure $next) // @phpcs:ignore
|
||||
{
|
||||
if ($this->auth->guest()) {
|
||||
if ($request->ajax() || $request->route()->getName() === 'play') {
|
||||
if ($request->ajax() || $request->wantsJson() || $request->route()->getName() === 'play') {
|
||||
return response('Unauthorized.', 401);
|
||||
} else {
|
||||
return redirect()->guest('/');
|
||||
|
|
Loading…
Reference in a new issue