'Stop the authentication thread'

def stop(self):

    if self.pipe:
        self.pipe.send('TERMINATE')
        if self.is_alive():
            self.thread.join()
        self.thread = None
        self.pipe.close()
        self.pipe = None
