Skip to content

Commit 5e43334

Browse files
authored
reset password
1 parent 8c17827 commit 5e43334

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/Jenssegers/Mongodb/Auth/PasswordBrokerManager.php

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,21 @@ class PasswordBrokerManager extends BasePasswordBrokerManager
1111
*/
1212
protected function createTokenRepository(array $config)
1313
{
14-
$laravel = app();
1514

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));
3119
}
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+
);
3230
}
3331
}

0 commit comments

Comments
 (0)