1313 **/
1414use Closure ;
1515use Illuminate \Support \Facades \Auth ;
16+ use Illuminate \Support \Facades \Log ;
17+ use Illuminate \Support \Facades \Route ;
1618use Illuminate \Support \Facades \Session ;
1719use Illuminate \Support \Facades \Redirect ;
1820use Illuminate \Support \Facades \URL ;
@@ -37,10 +39,40 @@ public function handle($request, Closure $next, $guard = null)
3739 Session::save ();
3840 return Redirect::action ('UserController@getLogin ' );
3941 }
42+
43+ // log debug info about the user and his request
44+ $ url = $ request ->getRequestUri ();
45+ $ method = $ request ->getMethod ();
46+ $ current_user = Auth::user ();
47+ Log::debug
48+ (
49+ sprintf
50+ (
51+ "Authenticate::handle method %s url %s current user %s (%s) groups %s " ,
52+ $ method ,
53+ $ url ,
54+ $ current_user ->getEmail (),
55+ $ current_user ->getId (),
56+ $ current_user ->getGroupsNice ()
57+ )
58+ );
4059 $ redirect = Session::get ('backurl ' );
4160 if (!empty ($ redirect )) {
4261 Session::forget ('backurl ' );
4362 Session::save ();
63+ Log::debug
64+ (
65+ sprintf
66+ (
67+ "Authenticate::handle method %s url %s current user %s (%s) groups %s redirecting to %s " ,
68+ $ method ,
69+ $ url ,
70+ $ current_user ->getEmail (),
71+ $ current_user ->getId (),
72+ $ current_user ->getGroupsNice (),
73+ $ redirect
74+ )
75+ );
4476 return Redirect::to ($ redirect );
4577 }
4678
0 commit comments