Skip to content

Commit c63e184

Browse files
awolfdenAdam Wolfman
and
Adam Wolfman
authored
Update UI/UX for Flask example apps (#45)
* Update UI for magic link * Update UI for MFA app * format with black * Update UI for Directory Sync * Update UI for admin portal app * Format with black * Pin version of urllib3 to all apps --------- Co-authored-by: Adam Wolfman <[email protected]>
1 parent b809290 commit c63e184

File tree

30 files changed

+1276
-994
lines changed

30 files changed

+1276
-994
lines changed

python-flask-admin-portal-example/app.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
import workos
55
from workos import client as workos_client
66
from workos import portal
7+
from flask_lucide import Lucide
78

89

910
# Flask Setup
1011
DEBUG = False
1112
app = Flask(__name__)
13+
lucide = Lucide(app)
1214

1315
# WorkOS Setup
1416
workos.api_key = os.getenv("WORKOS_API_KEY")
@@ -43,15 +45,8 @@ def provision_enterprise():
4345
return render_template("org_logged_in.html")
4446

4547

46-
@app.route("/sso_admin_portal", methods=["GET", "POST"])
47-
def sso_admin_portal():
48-
portal_link = workos_client.portal.generate_link(organization=org_id, intent="sso")
49-
return redirect(portal_link["link"])
50-
51-
52-
@app.route("/dsync_admin_portal", methods=["GET", "POST"])
53-
def dsync_admin_portal():
54-
portal_link = workos_client.portal.generate_link(
55-
organization=org_id, intent="dsync"
56-
)
48+
@app.route("/launch_admin_portal", methods=["GET", "POST"])
49+
def launch_admin_portal():
50+
intent = request.args.get("intent")
51+
portal_link = workos_client.portal.generate_link(organization=org_id, intent=intent)
5752
return redirect(portal_link["link"])

python-flask-admin-portal-example/requirements.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ MarkupSafe==2.0.1
99
requests==2.26.0
1010
urllib3==1.26.7
1111
Werkzeug==2.0.1
12-
workos>=1.21.0
13-
python-dotenv
12+
workos>=1.23.0
13+
python-dotenv
14+
flask-lucide==0.2.0

0 commit comments

Comments
 (0)