mirror of
https://github.com/quexten/goldwarden.git
synced 2024-11-27 11:02:46 +03:00
Merge branch 'main' into feature/error-dialogs-on-login
This commit is contained in:
commit
26d12fd5ce
@ -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__":
|
||||
|
@ -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"] == "":
|
||||
|
@ -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}")
|
||||
|
Loading…
Reference in New Issue
Block a user