File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
namespace Barryvdh \Debugbar \DataCollector ;
4
- use Illuminate \Contracts \ Auth \Guard ;
4
+ use Illuminate \Auth \Recaller ;
5
5
use Illuminate \Auth \SessionGuard ;
6
+ use Illuminate \Contracts \Auth \Guard ;
6
7
7
8
/**
8
9
* Collector for Laravel's Auth provider
@@ -58,17 +59,17 @@ private function resolveUser(Guard $guard)
58
59
// then we must resolve user „manually”
59
60
// to prevent csrf token regeneration
60
61
61
- $ usingSession = $ guard instanceof SessionGuard;
62
- $ recaller = $ usingSession ? $ guard ->getRequest ()->cookies ->get ($ guard ->getRecallerName ()) : null ;
62
+ $ recaller = $ guard instanceof SessionGuard
63
+ ? new Recaller ($ guard ->getRequest ()->cookies ->get ($ guard ->getRecallerName ()))
64
+ : null ;
63
65
64
- if ($ usingSession && !is_null ($ recaller )) {
65
- list ($ id , $ token ) = explode ('| ' , $ recaller );
66
- return $ guard ->getProvider ()->retrieveByToken ($ id , $ token );
66
+ if (!is_null ($ recaller ) && $ recaller ->valid ()) {
67
+ return $ guard ->getProvider ()->retrieveByToken ($ recaller ->id (), $ recaller ->token ());
67
68
} else {
68
69
return $ guard ->user ();
69
70
}
70
71
}
71
-
72
+
72
73
/**
73
74
* @{inheritDoc}
74
75
*/
You can’t perform that action at this time.
0 commit comments