Compare commits
No commits in common. "c9a06e5ada94be78cc5971cfec6165f0d182ab8e" and "4f007765f48178c93a61c73107be0ad68092c76c" have entirely different histories.
c9a06e5ada
...
4f007765f4
@ -1,2 +0,0 @@
|
||||
ALTER TABLE `oauth_tokens`
|
||||
ADD `audience` varchar(255) NOT NULL DEFAULT '';
|
@ -49,8 +49,7 @@ class OAuthAuthController implements ISecured
|
||||
}
|
||||
|
||||
$redirectUriParsed = parse_url($redirectUri);
|
||||
$redirectUriHost = $redirectUriParsed['scheme'] . '://' . $redirectUriParsed['host'];
|
||||
$redirectUriBase = $redirectUriHost . $redirectUriParsed['path'];
|
||||
$redirectUriBase = $redirectUriParsed['scheme'] . '://' . $redirectUriParsed['host'] . $redirectUriParsed['path'];
|
||||
$redirectUriQuery = [];
|
||||
if (isset($redirectUriParsed['query'])) {
|
||||
parse_str($redirectUriParsed['query'], $redirectUriQuery);
|
||||
@ -73,7 +72,6 @@ class OAuthAuthController implements ISecured
|
||||
$token->setUser($user);
|
||||
$token->setCode($code);
|
||||
$token->setAccessToken($accessToken);
|
||||
$token->setAudience($redirectUriHost);
|
||||
$token->setCreatedDate(new DateTime());
|
||||
$token->setExpiresDate(new DateTime('+5 minutes'));
|
||||
$this->pdm->saveToDb($token);
|
||||
|
@ -59,7 +59,6 @@ class OAuthController
|
||||
'iat' => (int)$token->getCreatedDate()->getTimestamp(),
|
||||
'nbf' => (int)$token->getCreatedDate()->getTimestamp(),
|
||||
'exp' => (int)$token->getExpiresDate()->getTimestamp(),
|
||||
'aud' => $token->getAudience(),
|
||||
'nonce' => $token->getNonce()
|
||||
], $this->getUserInfoInternal(
|
||||
$this->userRepository->getById($token->getUserId()),
|
||||
|
@ -7,7 +7,7 @@ class OAuthToken extends Model
|
||||
{
|
||||
protected static string $table = 'oauth_tokens';
|
||||
|
||||
protected static array $fields = ['scope', 'nonce', 'user_id', 'code', 'access_token', 'audience', 'created', 'expires'];
|
||||
protected static array $fields = ['scope', 'nonce', 'user_id', 'code', 'access_token', 'created', 'expires'];
|
||||
|
||||
protected static array $relations = ['user' => User::class];
|
||||
|
||||
@ -25,8 +25,6 @@ class OAuthToken extends Model
|
||||
|
||||
private string $accessToken = '';
|
||||
|
||||
private string $audience = '';
|
||||
|
||||
private DateTime $created;
|
||||
|
||||
private DateTime $expires;
|
||||
@ -66,11 +64,6 @@ class OAuthToken extends Model
|
||||
$this->accessToken = $accessToken;
|
||||
}
|
||||
|
||||
public function setAudience(string $audience): void
|
||||
{
|
||||
$this->audience = $audience;
|
||||
}
|
||||
|
||||
public function setCreatedDate(DateTime $created): void
|
||||
{
|
||||
$this->created = $created;
|
||||
@ -126,11 +119,6 @@ class OAuthToken extends Model
|
||||
return $this->accessToken;
|
||||
}
|
||||
|
||||
public function getAudience(): string
|
||||
{
|
||||
return $this->audience;
|
||||
}
|
||||
|
||||
public function getCreatedDate(): DateTime
|
||||
{
|
||||
return $this->created;
|
||||
|
Loading…
Reference in New Issue
Block a user