Skip to content

Commit

Permalink
Update UI/UX for Flask example apps (#45)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
awolfden and Adam Wolfman authored May 9, 2023
1 parent b809290 commit c63e184
Show file tree
Hide file tree
Showing 30 changed files with 1,276 additions and 994 deletions.
17 changes: 6 additions & 11 deletions python-flask-admin-portal-example/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import workos
from workos import client as workos_client
from workos import portal
from flask_lucide import Lucide


# Flask Setup
DEBUG = False
app = Flask(__name__)
lucide = Lucide(app)

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


@app.route("/sso_admin_portal", methods=["GET", "POST"])
def sso_admin_portal():
portal_link = workos_client.portal.generate_link(organization=org_id, intent="sso")
return redirect(portal_link["link"])


@app.route("/dsync_admin_portal", methods=["GET", "POST"])
def dsync_admin_portal():
portal_link = workos_client.portal.generate_link(
organization=org_id, intent="dsync"
)
@app.route("/launch_admin_portal", methods=["GET", "POST"])
def launch_admin_portal():
intent = request.args.get("intent")
portal_link = workos_client.portal.generate_link(organization=org_id, intent=intent)
return redirect(portal_link["link"])
5 changes: 3 additions & 2 deletions python-flask-admin-portal-example/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ MarkupSafe==2.0.1
requests==2.26.0
urllib3==1.26.7
Werkzeug==2.0.1
workos>=1.21.0
python-dotenv
workos>=1.23.0
python-dotenv
flask-lucide==0.2.0
Loading

0 comments on commit c63e184

Please sign in to comment.