public static function generateToken($payload = null)
    {
        if (empty($payload)) {
            return false;
        }

        $token = JWT::encode($payload, Configure::read('ApiRequest.jwtAuth.cypherKey'), Configure::read('ApiRequest.jwtAuth.tokenAlgorithm'));

        return $token;
    }
public static function generateToken($payload = null)
    {
        if (empty($payload)) {
            return false;
        }

        $token = JWT::encode($payload, Configure::read('ApiRequest.jwtAuth.cypherKey'), Configure::read('ApiRequest.jwtAuth.tokenAlgorithm'));

        return $token;
    }
public static function generateToken ( $ payload = null ) { if ( empty ( $ payload ) ) { return false ; } $ token = JWT :: encode ( $ payload , Configure :: read ( 'ApiRequest.jwtAuth.cypherKey' ) , Configure :: read ( 'ApiRequest.jwtAuth.tokenAlgorithm' ) ) ; return $ token ; }
Generates a token based on payload

@param mixed $payload Payload data to generate token
@return string|bool Token or false
Generates a token based on payload