Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Just-A-Regular-Guy authored Jun 5, 2024
1 parent 2c2224d commit 9d9dc90
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions client/securnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def receive():
if clear_message == 'PASS':
# Send credentials to server
client_socket.send(rsa.encrypt(credentials.encode(), client_private_key))
elif clear_message == "Invalid username or password":
print('bad authorization detected')
client_socket.close()
break
else:
# Display message in chat box
chat_box.insert(tkinter.END, '{}\n'.format(clear_message))
Expand Down Expand Up @@ -145,16 +149,24 @@ def login():

UNAME = entry_username.get()
PASSWD = entry_password.get()
credentials = f'{UNAME}@{PASSWD}'
print(credentials)

if HOST != '' and port != '' and UNAME != '' and PASSWD != '':
credentials = f'{UNAME}@{PASSWD}'
print(credentials)

# Connect to server
ADDR = (HOST, PORT)
client_socket.connect(ADDR)
# Connect to server
ADDR = (HOST, PORT)
client_socket.connect(ADDR)

# Start receive thread
receive_thread = Thread(target=receive, daemon=True)
receive_thread.start()
# Start receive thread
receive_thread = Thread(target=receive, daemon=True)
receive_thread.start()
else:
print('please compile all the input fields...')
pass




################################################## START OF GUI ##################################################

Expand Down

0 comments on commit 9d9dc90

Please sign in to comment.