我希望redirect
logout route
session
timeout
laravel 5.4
app\exception\handler.php
我在 if ($e instanceof TokenMismatchException) {
return redirect()->route('logout');
}
ResourceServerTokenServices
但它仍无效。我该怎么办
答案 0 :(得分:0)
当会话超时时,您基本上不再登录了。
您是否正在保护您需要使用auth
中间件登录的用户的路由?我想你错过了这一步。
如果用户未登录(或超时),auth
中间件保护的路由会自动重定向到/login
(路由可以更改)。
查看文档的这一部分:https://laravel.com/docs/5.4/authentication#protecting-routes