Skip to content

Commit 8746abb

Browse files
awolfdenAdam Wolfman
andauthored
Add audit logs visualization through Admin Portal link (#28)
Co-authored-by: Adam Wolfman <[email protected]>
1 parent 52d20ae commit 8746abb

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

python-flask-audit-logs-example/app.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ def get_events():
105105

106106
return redirect("export_events")
107107

108+
@app.route("/events", methods=["GET"])
109+
def events():
110+
link = workos.client.portal.generate_link(
111+
organization=session["organization_id"], intent="audit_logs"
112+
)
113+
114+
return redirect(link["link"])
115+
108116

109117
@app.route("/logout")
110118
def logout():

python-flask-audit-logs-example/templates/send_events.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ <h2 class="home-hero-gradient">Enterprise Ready</h2>
4444
<div class="flex_column width-40vw ">
4545
<div class="flex card width-40vw space-between ">
4646
<code class="org-id">{{organization_id}}</code>
47-
<a href="/logout"><button class="button">Change Org</button></a>
47+
<div>
48+
<a href="/events"><button class="button">Event Stream</button></a>
49+
<a href="/logout"><button class="button">Change Org</button></a>
50+
</div>
4851
</div>
4952
<div class="card width-40vw">
5053
<div class="flex space-evenly width-40vw margin-b-25">

0 commit comments

Comments
 (0)