0

我在 laravel 5.2 中使用 Auth,想知道如何更好地处理超时。目前我在控制器中使用这个函数来处理身份验证

    private function checkAuth()
    {
    if (!Auth::check()) {
        abort(404);
    }

    if (Auth::user()->clientId <> 100) {
        abort(403, 'Unauthorised Action - you are not authorized to see that');
    }

    }

我将超时设置为 15 分钟,并希望在发生超时时进行重定向。我希望重定向将您带到登录页面,并显示您已超时的警告。我还想在重新登录到原始页面后重定向。

4

0 回答 0