def regenerate_token(self, token):
    secret = self.config.get('jwt').get('secret')
    algorithm = self.config.get('jwt').get('algorithm')
    try:
        jwt.decode(token, secret, algorithms=[algorithm])
        return self.generate_token()
    except jwt.DecodeError:
        pass
    return False
def regenerate_token(self, token):
    secret = self.config.get('jwt').get('secret')
    algorithm = self.config.get('jwt').get('algorithm')
    try:
        jwt.decode(token, secret, algorithms=[algorithm])
        return self.generate_token()
    except jwt.DecodeError:
        pass
    return False