マスターパスワードの照合を追加

This commit is contained in:
suti7yk5032 2024-06-10 13:34:22 +09:00
parent 7087090211
commit 0f21c03003

View file

@ -103,12 +103,26 @@ class Lock(customtkinter.CTkToplevel):
"pc_number": int(client_config["pc_number"]),
"password": self.hash_genarate(str(self.password_entry.get()))
}
responce = requests.post(auth_url, json=auth_json)
try:
responce = requests.post(auth_url, json=auth_json)
except:
master_password_hash = self.hash_genarate(str(self.password_entry.get()))
if client_config["master_password_hash"] == master_password_hash:
self.destroy()
app.exit()
else:
self.msg_subtitle_1.configure(text='サインインするには、パスワードが必要です。\nネットワークエラーが発生しています。\n続行するには、マスターパスワードを入力して下さい。')
if responce.status_code == 200:
self.destroy()
app.exit()
else:
self.msg_subtitle_1.configure(text='サインインするには、パスワードが必要です。\nパスワードが違います!')
master_password_hash = self.hash_genarate(str(self.password_entry.get()))
if client_config["master_password_hash"] == master_password_hash:
self.destroy()
app.exit()
else:
self.msg_subtitle_1.configure(text='サインインするには、パスワードが必要です。\nパスワードが違います!')
def handler_close(self):
pass