| xqd
@@ -18,10 +18,10 @@ class Authenticate
|
|
|
public function handle($request, Closure $next, $guard = null)
|
|
|
{
|
|
|
if(Auth::guard($guard)->guest()) {
|
|
|
- \Log::info($guard);
|
|
|
- if($request->ajax()||$guard=="api") {
|
|
|
- \Log::info('Unauthorized Unauthorized ');
|
|
|
- return response('Unauthorized .', 401);
|
|
|
+// \Log::info($guard);
|
|
|
+ if($request->ajax()||$request->wantsJson()||$guard=="api") {
|
|
|
+// \Log::info('Unauthorized Unauthorized ');
|
|
|
+ return response('Unauthorized.', 401);
|
|
|
} else {
|
|
|
if($guard == 'admin') {
|
|
|
return redirect()->guest('admin/login');
|