Allow renewing password setup links
This commit is contained in:
parent
4efce34821
commit
746bf21715
2 changed files with 10 additions and 0 deletions
|
|
@ -472,6 +472,9 @@ class PortalApplication:
|
|||
status = tenant_account.status if tenant_account else AccountStatus.INVITED
|
||||
action = (
|
||||
f"""<span>Linked as {escape(directory.subject)}</span>
|
||||
<form method="post" action="/admin/{escape(tenant)}/users/{escape(membership.user_id)}/provision">
|
||||
<input type="hidden" name="csrf_token" value="{escape(csrf_token)}">
|
||||
<button type="submit">Create password setup link</button></form>
|
||||
<form method="post" action="/admin/{escape(tenant)}/users/{escape(membership.user_id)}/status">
|
||||
<input type="hidden" name="csrf_token" value="{escape(csrf_token)}">
|
||||
<input type="hidden" name="status" value="{'active' if status == AccountStatus.SUSPENDED else 'suspended'}">
|
||||
|
|
|
|||
|
|
@ -198,6 +198,13 @@ class PortalApplicationTests(unittest.TestCase):
|
|||
self.assertEqual("200 OK", handoff["status"])
|
||||
self.assertIn(b"Continue to password setup", html)
|
||||
self.assertIn(b"https://kc.example/setup/password?token=opaque", html)
|
||||
page, html = invoke(
|
||||
self.app,
|
||||
"/admin/tenant:friendly:binky",
|
||||
cookie="ue_session=browser",
|
||||
)
|
||||
self.assertEqual("200 OK", page["status"])
|
||||
self.assertIn(b"Create password setup link", html)
|
||||
|
||||
|
||||
class FakeProvisioning:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue