1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Illuminate\Auth\AuthenticationException: Unauthenticated.というエラーについて

1
Posted at

laravelのバージョンが5.5からunauthenticatedメソッドの場所が変わったから。
https://teratail.com/questions/97310

私はhandler.phpに

handler.php
 protected function unauthenticated($request, AuthenticationException $exception) 
     { 
         return $request->expectsJson() 
                     ? response()->json(['message' => 'Unauthenticated.'], 401) 
                     : redirect()->guest(route('login')); 
     } 

と書きました
以下参考↓
https://github.com/laravel/framework/commit/11b0de0485632d5712f7fb59071a4acbc4af2bdc

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?