diff --git a/incognia/api.py b/incognia/api.py index e926cc1..994d360 100644 --- a/incognia/api.py +++ b/incognia/api.py @@ -207,7 +207,9 @@ def register_login(self, policy_id: Optional[str] = None, device_os: Optional[str] = None, app_version: Optional[str] = None, + custom_properties: Optional[dict] = None, person_id: Optional[PersonID] = None) -> dict: + if not request_token: raise IncogniaError('request_token is required.') if not account_id: @@ -236,6 +238,7 @@ def register_login(self, 'policy_id': policy_id, 'device_os': device_os.lower() if device_os is not None else None, 'app_version': app_version, + 'custom_properties': custom_properties, 'person_id': person_id, } data = encode(body) diff --git a/tests/test_api.py b/tests/test_api.py index dab3398..3b41c2a 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -243,7 +243,8 @@ class TestIncogniaAPI(TestCase): 'policy_id': f'{POLICY_ID}', 'device_os': f'{DEVICE_OS.lower()}', 'app_version': f'{APP_VERSION}', - 'person_id': PERSON_ID + 'custom_properties': CUSTOM_PROPERTIES, + 'person_id': PERSON_ID, }) REGISTER_VALID_WEB_LOGIN_DATA: Final[bytes] = encode({ 'type': 'login', @@ -771,6 +772,7 @@ def test_register_login_with_all_fields_should_work( policy_id=self.POLICY_ID, device_os=self.DEVICE_OS, app_version=self.APP_VERSION, + custom_properties=self.CUSTOM_PROPERTIES, person_id=self.PERSON_ID) mock_token_manager_get.assert_called()