From e52348ac2c50357cb0be19ff95a5ed5f0a9e635a Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 22 Apr 2024 16:04:15 -0500 Subject: [PATCH] Support not passing password or registration token (better support for --local) --- fractal/cli/controllers/registration.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fractal/cli/controllers/registration.py b/fractal/cli/controllers/registration.py index bad3cd9..ec03114 100644 --- a/fractal/cli/controllers/registration.py +++ b/fractal/cli/controllers/registration.py @@ -115,8 +115,8 @@ def register_remote( def register( self, matrix_id: str, - password: str, - registration_token: str, + registration_token: Optional[str] = None, + password: Optional[str] = None, homeserver_url: Optional[str] = None, local: bool = False, ): @@ -126,12 +126,19 @@ def register( --- Args: matrix_id: Matrix ID of user to register. - password: Password to register with. registration_token: Registration token to use. + password: Password to register with. homeserver_url: Homeserver to register with. local: Whether to register locally or not. """ + if not password: + password = getpass("Enter your desired password: ") + + if not local and not registration_token: + print("Registration token is required for remote registration.") + exit(1) + access_token, homeserver_url = asyncio.run( self._register( matrix_id,