'Generate a JWT token with the provided payload.'

def generate_token(self, payload, secret=None):

    secret = (secret or self.JWT_SECRET_KEY)
    token = jwt.encode(payload, secret)
    return token
