Skip to content

Commit

Permalink
Support not passing password or registration token (better support fo…
Browse files Browse the repository at this point in the history
…r --local)
  • Loading branch information
justin-russell committed Apr 22, 2024
1 parent 799da2a commit e52348a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions fractal/cli/controllers/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
):
Expand All @@ -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,
Expand Down

0 comments on commit e52348a

Please sign in to comment.