Skip to content

Commit

Permalink
Adds a login helper method to AuthenticatedController
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-russell committed Apr 19, 2024
1 parent 9274650 commit 799da2a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fractal/cli/controllers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ class AuthenticatedController:
def __init__(self):
self.check_if_user_is_authenticated()

def _login(self, homeserver_url: str):
if not self.access_token:
matrix_id = input(f"Enter your matrix ID for {homeserver_url}: ")
access_token = AuthController().login(matrix_id, homeserver_url=homeserver_url)

self.matrix_id = matrix_id
self.access_token = access_token

@classmethod
def get_creds(cls) -> Optional[Tuple[Optional[str], Optional[str], Optional[str]]]:
"""
Expand Down

0 comments on commit 799da2a

Please sign in to comment.