File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
python-flask-magic-link-example Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 2
2
import json
3
3
from flask import Flask , render_template , request
4
4
import workos
5
- from workos import client as workos_client
6
5
7
6
# Flask Setup
8
7
DEBUG = False
9
8
app = Flask (__name__ )
10
9
11
10
# WorkOS Setup
12
- workos .api_key = os .getenv ("WORKOS_API_KEY" )
13
- workos .client_id = os .getenv ("WORKOS_CLIENT_ID" )
14
- workos .base_api_url = "http://localhost:5000/" if DEBUG else workos .base_api_url
11
+ base_api_url = "http://localhost:7000/" if DEBUG else None
12
+ workos_client = workos .WorkOSClient (
13
+ api_key = os .getenv ("WORKOS_API_KEY" ),
14
+ client_id = os .getenv ("WORKOS_CLIENT_ID" ),
15
+ base_url = base_api_url ,
16
+ )
15
17
16
18
redirect_uri = "http://localhost:5000/success"
17
19
@@ -50,6 +52,6 @@ def success():
50
52
code = request .args .get ("code" )
51
53
if not code :
52
54
return "No code provided"
53
- profile = workos . client .sso .get_profile_and_token (code )
55
+ profile = workos_client .sso .get_profile_and_token (code )
54
56
55
57
return render_template ("success.html" , raw_profile = profile .dict ())
You can’t perform that action at this time.
0 commit comments