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 66use Illuminate \Auth \AuthenticationException ;
77use Illuminate \Contracts \Auth \Factory as AuthFactory ;
88use Illuminate \Contracts \Session \Middleware \AuthenticatesSessions ;
9+ use Illuminate \Http \Request ;
910
1011class AuthenticateSession implements AuthenticatesSessions
1112{
@@ -94,7 +95,9 @@ protected function logout($request)
9495
9596 $ request ->session ()->flush ();
9697
97- throw new AuthenticationException ('Unauthenticated. ' , [$ this ->auth ->getDefaultDriver ()]);
98+ throw new AuthenticationException (
99+ 'Unauthenticated. ' , [$ this ->auth ->getDefaultDriver ()], $ this ->redirectTo ($ request )
100+ );
98101 }
99102
100103 /**
@@ -106,4 +109,15 @@ protected function guard()
106109 {
107110 return $ this ->auth ;
108111 }
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+ }
109123}
You can’t perform that action at this time.
0 commit comments