for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace CustomerGauge\Cognito;
use CustomerGauge\Cognito\Parsers\ClientAppParser;
use Exception;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Contracts\Auth\UserProvider;
final class CognitoUserProvider implements UserProvider
{
private $clientAppParser;
private $accessTokenParser;
$accessTokenParser
public function __construct(ClientAppParser $clientAppParser/*, AccessTokenParser $accessTokenParser*/)
$this->clientAppParser = $clientAppParser;
// $this->accessTokenParser = $accessTokenParser;
}
public function retrieveByCredentials(array $credentials)
$token = $credentials['cognito_token'];
try {
return $this->clientAppParser->parse($token);
} catch (Exception $e) {
/*
return $this->accessTokenParser->parse($token);
*/
return null;
/** @phpstan ignore */
public function validateCredentials(Authenticatable $user, array $credentials)
public function retrieveById($identifier)
public function retrieveByToken($identifier, $token)
public function updateRememberToken(Authenticatable $user, $token)