File tree Expand file tree Collapse file tree 1 file changed +14
-16
lines changed
src/Jenssegers/Mongodb/Auth Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -11,23 +11,21 @@ class PasswordBrokerManager extends BasePasswordBrokerManager
11
11
*/
12
12
protected function createTokenRepository (array $ config )
13
13
{
14
- $ laravel = app ();
15
14
16
- if (version_compare ($ laravel ::VERSION , '5.4 ' , '>= ' )) {
17
- return new DatabaseTokenRepository (
18
- $ this ->app ['db ' ]->connection (),
19
- $ this ->app ['hash ' ],
20
- $ config ['table ' ],
21
- $ this ->app ['config ' ]['app.key ' ],
22
- $ config ['expire ' ]
23
- );
24
- } else {
25
- return new DatabaseTokenRepository (
26
- $ this ->app ['db ' ]->connection (),
27
- $ config ['table ' ],
28
- $ this ->app ['config ' ]['app.key ' ],
29
- $ config ['expire ' ]
30
- );
15
+ $ key = $ this ->app ['config ' ]['app.key ' ];
16
+
17
+ if (\Illuminate \Support \Str::startsWith ($ key , 'base64: ' )) {
18
+ $ key = base64_decode (substr ($ key , 7 ));
31
19
}
20
+
21
+ $ connection = isset ($ config ['connection ' ]) ? $ config ['connection ' ] : null ;
22
+
23
+ return new DatabaseTokenRepository (
24
+ $ this ->app ['db ' ]->connection (),
25
+ $ this ->app ['hash ' ],
26
+ $ config ['table ' ],
27
+ $ this ->app ['config ' ]['app.key ' ],
28
+ $ config ['expire ' ]
29
+ );
32
30
}
33
31
}
You can’t perform that action at this time.
0 commit comments