Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions descope/management/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def invite(
] = None, # send invite via text message, default is according to project settings
additional_login_ids: Optional[List[str]] = None,
sso_app_ids: Optional[List[str]] = None,
template_id: str = "",
) -> dict:
"""
Create a new user and invite them via an email / text message.
Expand Down Expand Up @@ -267,6 +268,7 @@ def invite(
send_sms,
additional_login_ids,
sso_app_ids,
template_id,
),
pswd=self._auth.management_key,
)
Expand Down Expand Up @@ -1652,6 +1654,7 @@ def _compose_create_body(
send_sms: Optional[bool],
additional_login_ids: Optional[List[str]],
sso_app_ids: Optional[List[str]] = None,
template_id: str = "",
) -> dict:
body = User._compose_update_body(
login_id=login_id,
Expand Down Expand Up @@ -1680,6 +1683,8 @@ def _compose_create_body(
body["sendMail"] = send_mail
if send_sms is not None:
body["sendSMS"] = send_sms
if template_id != "":
body["templateId"] = template_id
return body

@staticmethod
Expand Down
2 changes: 2 additions & 0 deletions tests/management/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def test_invite(self):
invite_url="invite.me",
send_sms=True,
sso_app_ids=["app1", "app2"],
template_id="tid",
)
user = resp["user"]
self.assertEqual(user["id"], "u1")
Expand Down Expand Up @@ -264,6 +265,7 @@ def test_invite(self):
"sendSMS": True,
"additionalLoginIds": None,
"ssoAppIDs": ["app1", "app2"],
"templateId": "tid",
},
allow_redirects=False,
verify=True,
Expand Down
Loading