X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/3acea12f1c0013be4f1e3994cae2ea662e43bb4e..refs/pull/2393/head:/app/Auth/Access/UserTokenService.php diff --git a/app/Auth/Access/UserTokenService.php b/app/Auth/Access/UserTokenService.php index 34f3b2851..a1defbf62 100644 --- a/app/Auth/Access/UserTokenService.php +++ b/app/Auth/Access/UserTokenService.php @@ -5,6 +5,7 @@ use BookStack\Exceptions\UserTokenExpiredException; use BookStack\Exceptions\UserTokenNotFoundException; use Carbon\Carbon; use Illuminate\Database\Connection as Database; +use Illuminate\Support\Str; use stdClass; class UserTokenService @@ -73,9 +74,9 @@ class UserTokenService */ protected function generateToken() : string { - $token = str_random(24); + $token = Str::random(24); while ($this->tokenExists($token)) { - $token = str_random(25); + $token = Str::random(25); } return $token; } @@ -130,5 +131,4 @@ class UserTokenService return Carbon::now()->subHours($this->expiryTime) ->gt(new Carbon($tokenEntry->created_at)); } - -} \ No newline at end of file +}