def generate_token(self):
    secret = self.config.get('jwt').get('secret')
    algorithm = self.config.get('jwt').get('algorithm')
    expire_minutes = self.config.get('jwt').get('expires')
    version = self.config.get('jwt').get('version')
    if expire_minutes:
        expire_minutes = pendulum.now(tz='UTC').add(minutes=expire_minutes).to_datetime_string()
    token = jwt.encode({'expires': expire_minutes, 'version': version, 'random': random_string(10)}, secret, algorithm=algorithm)
    return token
def generate_token(self):
    secret = self.config.get('jwt').get('secret')
    algorithm = self.config.get('jwt').get('algorithm')
    expire_minutes = self.config.get('jwt').get('expires')
    version = self.config.get('jwt').get('version')
    if expire_minutes:
        expire_minutes = pendulum.now(tz='UTC').add(minutes=expire_minutes).to_datetime_string()
    token = jwt.encode({'expires': expire_minutes, 'version': version, 'random': random_string(10)}, secret, algorithm=algorithm)
    return token