Lcobucci\JWT\Builder::unsign PHP Method

unsign() public method

Removes the signature from the builder
public unsign ( ) : Builder
return Builder
    public function unsign() : Builder
    {
        $this->signature = null;
        return $this;
    }

Usage Example

Example #1
0
 public function createToken(AuthenticatableContract $user)
 {
     $payload = $this->buildTokenPayload($user);
     $this->builder->unsign();
     // set additional payload data
     foreach ($payload as $key => $value) {
         $this->builder->set($key, $value);
     }
     $now = time();
     $lifespanSecs = $this->config['lifespan'] * 60;
     return $this->builder->setIssuedAt($now)->setExpiration($now + $lifespanSecs)->sign(new $this->signer(), $this->secret)->getToken();
     // Retrieves the generated token
 }
All Usage Examples Of Lcobucci\JWT\Builder::unsign