b0y-101 Mini Shell


Current Path : E:/www2/risk/libraries/vendor/lcobucci/jwt/src/Validation/Constraint/
File Upload :
Current File : E:/www2/risk/libraries/vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php

<?php

namespace Lcobucci\JWT\Validation\Constraint;

use Lcobucci\JWT\Token;
use Lcobucci\JWT\Validation\Constraint;
use Lcobucci\JWT\Validation\ConstraintViolation;

final class PermittedFor implements Constraint
{
    /** @var string  */
    private $audience;

    public function __construct($audience)
    {
        $this->audience = $audience;
    }

    public function assert(Token $token)
    {
        if (! $token->isPermittedFor($this->audience)) {
            throw new ConstraintViolation(
                'The token is not allowed to be used by this audience'
            );
        }
    }
}

Copyright © 2019 by b0y-101