Skip to content

Commit

Permalink
Fix str_random()
Browse files Browse the repository at this point in the history
Fix composer requirements
  • Loading branch information
andcarpi committed Sep 5, 2019
1 parent 06cdc34 commit 4060273
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
build
composer.lock
vendor
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"name": "zefy/laravel-sso",
"name": "andcarpi/laravel-sso",
"description": "Simple PHP SSO integration for Laravel",
"keywords": ["laravel", "sso", "authentication", "login"],
"homepage": "https://github.com/zefy/laravel-sso",
"homepage": "https://github.com/andcarpi/laravel-sso",
"license": "MIT",
"authors": [
{
"name": "Anderson Carpi",
"email": "kustelac@yahoo.com.br",
"homepage": "https://github.com/andcarpi",
"role": "Developer"
},
{
"name": "Martynas Žaliaduonis",
"email": "m.zaliaduonis@gmail.com",
Expand All @@ -14,8 +20,8 @@
],
"require": {
"php": ">=7.1.3",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^5.5",
"guzzlehttp/guzzle": ">=6.3",
"laravel/framework": ">=5.5",
"zefy/php-simple-sso": "^1.0"
},
"autoload": {
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/CreateBroker.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Zefy\LaravelSSO\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Str;

class CreateBroker extends Command
{
Expand Down Expand Up @@ -41,7 +42,7 @@ public function handle()
$broker = new $brokerClass;

$broker->name = $this->argument('name');
$broker->secret = str_random(40);
$broker->secret = Str::random(40);

$broker->save();

Expand Down
3 changes: 2 additions & 1 deletion src/LaravelSSOBroker.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Zefy\LaravelSSO;

use Illuminate\Support\Facades\Cookie;
use Illuminate\Support\Str;
use Zefy\LaravelSSO\Exceptions\MissingConfigurationException;
use Zefy\SimpleSSO\SSOBroker;
use GuzzleHttp;
Expand Down Expand Up @@ -68,7 +69,7 @@ protected function saveToken()
}

// If cookie token doesn't exist, we need to create it with unique token...
$this->token = str_random(40);
$this->token = Str::random(40);
Cookie::queue(Cookie::make($this->getCookieName(), $this->token, 60));

// ... and attach it to broker session in SSO server.
Expand Down

0 comments on commit 4060273

Please sign in to comment.