code/dispatcher/authenticator/jwt.php
public function createToken(UserInterface $user = null)
    {
        if(!$user) {
            $user = $this->getObject('user');
        }

        $token = $this->getObject('lib:http.token')
            ->setSubject($user->getId())
            ->sign($this->getSecret());

        return $token;
    }
public function createToken(UserInterface $user = null)
    {
        if(!$user) {
            $user = $this->getObject('user');
        }

        $token = $this->getObject('lib:http.token')
            ->setSubject($user->getId())
            ->sign($this->getSecret());

        return $token;
    }
public function createToken ( UserInterface $ user = null ) { if ( ! $ user ) { $ user = $ this -> getObject ( 'user' ) ; } $ token = $ this -> getObject ( 'lib:http.token' ) -> setSubject ( $ user -> getId ( ) ) -> sign ( $ this -> getSecret ( ) ) ; return $ token ; }
Create a new signed JWT authorisation token

If not user passed, the context user object will be used.

@param UserInterface $user The user object. Default NULL
@return string  The signed authorisation token
Create a new signed JWT authorisation token