mirror of
				https://github.com/webmasterskaya/joomla-oauth-server.git
				synced 2025-11-04 06:33:22 +03:00 
			
		
		
		
	Переделал проверку на try/catch
This commit is contained in:
		
							parent
							
								
									78486a87a8
								
							
						
					
					
						commit
						6089848c68
					
				@ -42,10 +42,17 @@ class AccessTokenRepository implements AccessTokenRepositoryInterface
 | 
			
		||||
 | 
			
		||||
    public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity): void
 | 
			
		||||
    {
 | 
			
		||||
        $found = false;
 | 
			
		||||
        try {
 | 
			
		||||
            /** @var AccessToken $accessTokenEntity */
 | 
			
		||||
            $accessToken = $this->accessTokenModel->getItemByIdentifier($accessTokenEntity->getIdentifier());
 | 
			
		||||
 | 
			
		||||
            if ($accessToken->id > 0) {
 | 
			
		||||
                $found = true;
 | 
			
		||||
            }
 | 
			
		||||
        } catch (\Throwable $e) {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($found) {
 | 
			
		||||
            throw UniqueTokenIdentifierConstraintViolationException::create();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user