Skip to content

Commit cdd2936

Browse files
committed
Replace DEBUG global with an env variable to set the base api url
1 parent 70fb316 commit cdd2936

File tree

6 files changed

+6
-12
lines changed
  • python-flask-admin-portal-example
  • python-flask-audit-logs-example
  • python-flask-directory-sync-example
  • python-flask-mfa-example
  • python-flask-sso-example

6 files changed

+6
-12
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77

88

99
# Flask Setup
10-
DEBUG = False
1110
app = Flask(__name__)
1211
lucide = Lucide(app)
1312

1413
# WorkOS Setup
15-
base_api_url = "http://localhost:7000/" if DEBUG else None
14+
base_api_url = os.getenv("WORKOS_BASE_API_URL")
1615
workos_client = workos.WorkOSClient(
1716
api_key=os.getenv("WORKOS_API_KEY"),
1817
client_id=os.getenv("WORKOS_CLIENT_ID"),

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111

1212

1313
# Flask Setup
14-
DEBUG = False
1514
app = Flask(__name__)
1615
app.secret_key = os.getenv("APP_SECRET_KEY")
1716

1817
lucide = Lucide(app)
1918

2019

2120
# WorkOS Setup
22-
base_api_url = "http://localhost:7000/" if DEBUG else None
21+
base_api_url = os.getenv("WORKOS_BASE_API_URL")
2322
workos_client = workos.WorkOSClient(
2423
api_key=os.getenv("WORKOS_API_KEY"),
2524
client_id=os.getenv("WORKOS_CLIENT_ID"),

python-flask-directory-sync-example/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from flask_lucide import Lucide
77

88

9-
DEBUG = False
109
app = Flask(__name__)
1110

1211
lucide = Lucide(app)
@@ -17,7 +16,7 @@
1716
if __name__ == "__main__":
1817
socketio.run(app) # type: ignore
1918

20-
base_api_url = "http://localhost:7000/" if DEBUG else None
19+
base_api_url = os.getenv("WORKOS_BASE_API_URL")
2120
workos_client = workos.WorkOSClient(api_key=os.getenv("WORKOS_API_KEY"), client_id=os.getenv("WORKOS_CLIENT_ID"), base_url=base_api_url)
2221
directory_id = os.getenv("DIRECTORY_ID")
2322

python-flask-magic-link-example/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
import workos
55

66
# Flask Setup
7-
DEBUG = False
87
app = Flask(__name__)
98

109
# WorkOS Setup
11-
base_api_url = "http://localhost:7000/" if DEBUG else None
10+
base_api_url = os.getenv("WORKOS_BASE_API_URL")
1211
workos_client = workos.WorkOSClient(
1312
api_key=os.getenv("WORKOS_API_KEY"),
1413
client_id=os.getenv("WORKOS_CLIENT_ID"),

python-flask-mfa-example/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
from flask_lucide import Lucide
66

77
# Flask Setup
8-
DEBUG = False
98
app = Flask(__name__)
109
app.secret_key = os.getenv("APP_SECRET_KEY")
1110
lucide = Lucide(app)
1211

1312
# WorkOS Setup
14-
base_api_url = "http://localhost:7000/" if DEBUG else None
13+
base_api_url = os.getenv("WORKOS_BASE_API_URL")
1514
workos_client = workos.WorkOSClient(
1615
api_key=os.getenv("WORKOS_API_KEY"),
1716
client_id=os.getenv("WORKOS_CLIENT_ID"),

python-flask-sso-example/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55

66

77
# Flask Setup
8-
DEBUG = False
98
app = Flask(__name__)
109
app.secret_key = os.getenv("APP_SECRET_KEY")
10+
base_api_url = os.getenv("WORKOS_BASE_API_URL")
1111

1212
# WorkOS Setup
13-
base_api_url = "http://localhost:7000/" if DEBUG else None
1413
workos_client = workos.WorkOSClient(
1514
api_key=os.getenv("WORKOS_API_KEY"),
1615
client_id=os.getenv("WORKOS_CLIENT_ID"),

0 commit comments

Comments
 (0)