Merge branch 'main' into feature/error-dialogs-on-login
This commit is contained in:
commit
26d12fd5ce
3 changed files with 10 additions and 4 deletions
|
|
@ -47,8 +47,8 @@ class GoldwardenLoginApp(Adw.Application):
|
||||||
|
|
||||||
def on_login(self):
|
def on_login(self):
|
||||||
email = self.email_row.get_text()
|
email = self.email_row.get_text()
|
||||||
client_id = self.client_id_row.get_text()
|
client_id = self.client_id_row.get_text().strip()
|
||||||
client_secret = self.client_secret_row.get_text()
|
client_secret = self.client_secret_row.get_text().strip()
|
||||||
server = self.server_row.get_text()
|
server = self.server_row.get_text()
|
||||||
try:
|
try:
|
||||||
goldwarden.set_server(server)
|
goldwarden.set_server(server)
|
||||||
|
|
@ -61,10 +61,12 @@ class GoldwardenLoginApp(Adw.Application):
|
||||||
dialog.add_response("ok", "Dismiss")
|
dialog.add_response("ok", "Dismiss")
|
||||||
dialog.present()
|
dialog.present()
|
||||||
return
|
return
|
||||||
|
|
||||||
if client_id != "":
|
if client_id != "":
|
||||||
goldwarden.set_client_id(client_id)
|
goldwarden.set_client_id(client_id)
|
||||||
if client_secret != "":
|
if client_secret != "":
|
||||||
goldwarden.set_client_secret(client_secret)
|
goldwarden.set_client_secret(client_secret)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
goldwarden.login_with_password(email, "")
|
goldwarden.login_with_password(email, "")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
@ -83,6 +85,7 @@ class GoldwardenLoginApp(Adw.Application):
|
||||||
dialog.add_response("ok", "Dismiss")
|
dialog.add_response("ok", "Dismiss")
|
||||||
dialog.present()
|
dialog.present()
|
||||||
return
|
return
|
||||||
|
|
||||||
self.window.close()
|
self.window.close()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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
|
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
|
copy_combo = state & Gdk.ModifierType.CONTROL_MASK and not state & Gdk.ModifierType.SHIFT_MASK
|
||||||
|
|
||||||
|
if not len(self.filtered_logins) > 0:
|
||||||
|
return
|
||||||
|
|
||||||
# totp code
|
# totp code
|
||||||
if keyval == Gdk.KEY_t or keyval == Gdk.KEY_T:
|
if keyval == Gdk.KEY_t or keyval == Gdk.KEY_T:
|
||||||
if self.filtered_logins[self.selected_index]["totp"] == "":
|
if self.filtered_logins[self.selected_index]["totp"] == "":
|
||||||
|
|
|
||||||
|
|
@ -83,10 +83,10 @@ def get_environment():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def set_client_id(client_id):
|
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):
|
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):
|
def login_with_password(email, password):
|
||||||
result = send_authenticated_command(f"vault login --email {email}")
|
result = send_authenticated_command(f"vault login --email {email}")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue