Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 6 Support #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"require": {
"php": ">= 5.6.4",
"aws/aws-sdk-php-laravel": "^3.1",
"nesbot/carbon": "~1.20",
"laravel/framework": "^5.7.0"
"nesbot/carbon": "^2.0.0",
"laravel/framework": "^5.7.0 | ^6.0.0"
},
"autoload": {
"psr-0": {
Expand Down
15 changes: 8 additions & 7 deletions src/AwsCognitoIdentityGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Illuminate\Contracts\Cookie\QueueingFactory as CookieJar;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Session\Session;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use RuntimeException;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -548,8 +549,8 @@ protected function storeCognitoTokensInSession(array $tokens)
protected function attemptCognitoAuthentication(array $credentials)
{
if (
!$username = array_get($credentials, $this->config['username-attribute']) OR
!$password = array_get($credentials, 'password')
!$username = Arr::get($credentials, $this->config['username-attribute']) OR
!$password = Arr::get($credentials, 'password')
) {
return new AuthAttempt(false);
}
Expand Down Expand Up @@ -830,7 +831,7 @@ public function getLastAttempted()
*/
public function getCognitoAccessToken()
{
return array_get($this->cognitoTokens, 'AccessToken');
return Arr::get($this->cognitoTokens, 'AccessToken');
}

/**
Expand All @@ -840,7 +841,7 @@ public function getCognitoAccessToken()
*/
public function getCognitoIdToken()
{
return array_get($this->cognitoTokens, 'IdToken');
return Arr::get($this->cognitoTokens, 'IdToken');
}

/**
Expand All @@ -850,7 +851,7 @@ public function getCognitoIdToken()
*/
public function getCognitoRefreshToken()
{
return array_get($this->cognitoTokens, 'RefreshToken');
return Arr::get($this->cognitoTokens, 'RefreshToken');
}

/**
Expand All @@ -861,7 +862,7 @@ public function getCognitoRefreshToken()
*/
public function getCognitoTokensExpiryTime()
{
return array_get($this->cognitoTokens, 'ExpiresIn');
return Arr::get($this->cognitoTokens, 'ExpiresIn');
}

/**
Expand All @@ -871,7 +872,7 @@ public function getCognitoTokensExpiryTime()
*/
public function getCognitoRefreshTokenExpiryTime()
{
return array_get($this->cognitoTokens, 'RefreshTokenExpires');
return Arr::get($this->cognitoTokens, 'RefreshTokenExpires');
}

/**
Expand Down