Skip to content

Commit

Permalink
Fix login client role
Browse files Browse the repository at this point in the history
Co-authored-by: Shubham Gupta <[email protected]>
  • Loading branch information
kiendang and shubham3121 committed Oct 18, 2023
1 parent 1838f3b commit 5d80b3a
Show file tree
Hide file tree
Showing 3 changed files with 858 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hagrid/hagrid/orchestra.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __init__(
def client(self) -> Any:
if self.port:
sy = get_syft_client()
return sy.login(url=self.url, port=self.port) # type: ignore
return sy.login_as_guest(url=self.url, port=self.port) # type: ignore
elif self.deployment_type == DeploymentType.PYTHON:
return self.python_node.get_guest_client(verbose=False) # type: ignore
else:
Expand Down
6 changes: 6 additions & 0 deletions packages/syft/src/syft/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,12 @@ def login(
credentials=signing_key,
)

client.__logged_in_user = email

if user_private_key is not None:
client.__user_role = user_private_key.role
client.__logged_in_username = client.users.get_current_user().name

if signing_key is not None:
print(
f"Logged into <{client.name}: {client.metadata.node_side_type.capitalize()} side "
Expand Down
Loading

0 comments on commit 5d80b3a

Please sign in to comment.