Skip to content

Commit

Permalink
CTD-1028 Added device Id to authorise call
Browse files Browse the repository at this point in the history
  • Loading branch information
tom committed Nov 18, 2021
1 parent 2b2bffe commit 04e3755
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion livestyled/__init__.py
@@ -1 +1 @@
__version__ = '1.1.45'
__version__ = '1.1.46'
7 changes: 5 additions & 2 deletions livestyled/resource_client.py
Expand Up @@ -505,16 +505,19 @@ def update_user_info(
def authorise_user(
self,
user: User,
password: str
password: str,
device_id: int = None
) -> Dict:
if user.id is None:
raise ValueError('Need a user ID to authorise a user')
if not password:
raise ValueError('Need a password to authorise a user')
device = {'deviceId': device_id} if device_id is not None else {}
user_auth_response = self._api_post(
'v4/{}'.format(UserSchema.Meta.authorise_url.format(user.id)),
{
'password': password
'password': password,
**device
}
)
return user_auth_response
Expand Down

0 comments on commit 04e3755

Please sign in to comment.