File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/Illuminate/Session/Middleware Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 6
6
use Illuminate \Auth \AuthenticationException ;
7
7
use Illuminate \Contracts \Auth \Factory as AuthFactory ;
8
8
use Illuminate \Contracts \Session \Middleware \AuthenticatesSessions ;
9
+ use Illuminate \Http \Request ;
9
10
10
11
class AuthenticateSession implements AuthenticatesSessions
11
12
{
@@ -94,7 +95,9 @@ protected function logout($request)
94
95
95
96
$ request ->session ()->flush ();
96
97
97
- throw new AuthenticationException ('Unauthenticated. ' , [$ this ->auth ->getDefaultDriver ()]);
98
+ throw new AuthenticationException (
99
+ 'Unauthenticated. ' , [$ this ->auth ->getDefaultDriver ()], $ this ->redirectTo ($ request )
100
+ );
98
101
}
99
102
100
103
/**
@@ -106,4 +109,15 @@ protected function guard()
106
109
{
107
110
return $ this ->auth ;
108
111
}
112
+
113
+ /**
114
+ * Get the path the user should be redirected to when their session is not autheneticated.
115
+ *
116
+ * @param \Illuminate\Http\Request $request
117
+ * @return string|null
118
+ */
119
+ protected function redirectTo (Request $ request )
120
+ {
121
+ //
122
+ }
109
123
}
You can’t perform that action at this time.
0 commit comments