Merge branch 'main' into feature/error-dialogs-on-login

This commit is contained in:
Bernd Schoolmann 2024-05-11 04:28:46 +02:00 committed by GitHub
commit 26d12fd5ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 4 deletions

View File

@ -47,8 +47,8 @@ class GoldwardenLoginApp(Adw.Application):
def on_login(self):
email = self.email_row.get_text()
client_id = self.client_id_row.get_text()
client_secret = self.client_secret_row.get_text()
client_id = self.client_id_row.get_text().strip()
client_secret = self.client_secret_row.get_text().strip()
server = self.server_row.get_text()
try:
goldwarden.set_server(server)
@ -61,10 +61,12 @@ class GoldwardenLoginApp(Adw.Application):
dialog.add_response("ok", "Dismiss")
dialog.present()
return
if client_id != "":
goldwarden.set_client_id(client_id)
if client_secret != "":
goldwarden.set_client_secret(client_secret)
try:
goldwarden.login_with_password(email, "")
except Exception as e:
@ -83,6 +85,7 @@ class GoldwardenLoginApp(Adw.Application):
dialog.add_response("ok", "Dismiss")
dialog.present()
return
self.window.close()
if __name__ == "__main__":

View File

@ -69,6 +69,9 @@ class GoldwardenQuickAccessApp(Adw.Application):
auto_type_combo = state & Gdk.ModifierType.CONTROL_MASK and state & Gdk.ModifierType.SHIFT_MASK
copy_combo = state & Gdk.ModifierType.CONTROL_MASK and not state & Gdk.ModifierType.SHIFT_MASK
if not len(self.filtered_logins) > 0:
return
# totp code
if keyval == Gdk.KEY_t or keyval == Gdk.KEY_T:
if self.filtered_logins[self.selected_index]["totp"] == "":

View File

@ -83,10 +83,10 @@ def get_environment():
return None
def set_client_id(client_id):
send_authenticated_command(f"config set-client-id \"{client_id}\"")
return send_authenticated_command(f"config set-client-id {client_id}")
def set_client_secret(client_secret):
send_authenticated_command(f"config set-client-secret \"{client_secret}\"")
return send_authenticated_command(f"config set-client-secret {client_secret}")
def login_with_password(email, password):
result = send_authenticated_command(f"vault login --email {email}")