Unverified Commit 5e433343 authored by Le The Hoang's avatar Le The Hoang Committed by GitHub

reset password

parent 8c17827d
...@@ -11,23 +11,21 @@ class PasswordBrokerManager extends BasePasswordBrokerManager ...@@ -11,23 +11,21 @@ class PasswordBrokerManager extends BasePasswordBrokerManager
*/ */
protected function createTokenRepository(array $config) protected function createTokenRepository(array $config)
{ {
$laravel = app();
if (version_compare($laravel::VERSION, '5.4', '>=')) { $key = $this->app['config']['app.key'];
return new DatabaseTokenRepository(
$this->app['db']->connection(), if (\Illuminate\Support\Str::startsWith($key, 'base64:')) {
$this->app['hash'], $key = base64_decode(substr($key, 7));
$config['table'],
$this->app['config']['app.key'],
$config['expire']
);
} else {
return new DatabaseTokenRepository(
$this->app['db']->connection(),
$config['table'],
$this->app['config']['app.key'],
$config['expire']
);
} }
$connection = isset($config['connection']) ? $config['connection'] : null;
return new DatabaseTokenRepository(
$this->app['db']->connection(),
$this->app['hash'],
$config['table'],
$this->app['config']['app.key'],
$config['expire']
);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment