def authorize(self, client): # where we authorize the user. """ In this method we are trying to get password and user name from the client and check if he has logged on another pc or if his credinitals are correct """ while True: try: data = client.recv(1024) user_and_pass = pickle.loads(data) user = UserHandler(user_and_pass[1], user_and_pass[2]) if user_and_pass[ 0] == 'Register': # if user was trying to register auth = user.register() auth_ = pickle.dumps(auth) client.send(auth_) if auth == "Successfully Registered": self.receive(client, user_and_pass[1], user) else: continue else: # if user was trying to login auth = user.login() auth_ = pickle.dumps(auth) client.send(auth_) if auth == "Successfully Logged In": self.receive(client, user_and_pass[1], user) break else: continue except: break