File tree Expand file tree Collapse file tree 5 files changed +109
-9
lines changed
python-flask-directory-sync-example Expand file tree Collapse file tree 5 files changed +109
-9
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,15 @@ def directory_users():
61
61
return render_template ("users.html" , users = users )
62
62
63
63
64
+ @app .route ("/user" )
65
+ def directory_user ():
66
+ user_id = request .args .get ("id" )
67
+ user = workos .client .directory_sync .get_user (
68
+ user_id = user_id )
69
+ print (user .model_dump ())
70
+ return render_template ("user.html" , user = user .model_dump (), id = user_id )
71
+
72
+
64
73
@app .route ("/groups" )
65
74
def directory_groups ():
66
75
directory_id = request .args .get ("id" )
@@ -70,6 +79,15 @@ def directory_groups():
70
79
return render_template ("groups.html" , groups = groups )
71
80
72
81
82
+ @app .route ("/group" )
83
+ def directory_group ():
84
+ group_id = request .args .get ("id" )
85
+ group = workos_client .directory_sync .get_group (
86
+ group_id = group_id )
87
+
88
+ return render_template ("group.html" , group = group .model_dump (), id = group_id )
89
+
90
+
73
91
@app .route ("/webhooks" , methods = ["GET" , "POST" ])
74
92
def webhooks ():
75
93
if request .data :
Original file line number Diff line number Diff line change
1
+ < html >
2
+
3
+ < head >
4
+ < link rel ="stylesheet " href ="../static/home.css ">
5
+ </ head >
6
+
7
+ < body class ="container_success ">
8
+ < div class ="logged_in_nav ">
9
+ < div class ="flex ">
10
+ < div >
11
+ < img src ="../static/images/workos-logo-with-text.png " alt ="workos logo ">
12
+ </ div >
13
+ </ div >
14
+ < div >
15
+ < a href ="https://workos.com/docs " target ="_blank "> < button class ='button nav-item '> Documentation</ button > </ a >
16
+ < a href ="https://workos.com/docs/reference " target ="_blank "> < button class ='button nav-item '> API
17
+ Reference</ button > </ a >
18
+ < a href ="https://workos.com/blog " target ="_blank "> < button
19
+ class ='button nav-item blog-nav-button '> Blog</ button > </ a >
20
+ < a href ="https://workos.com/ " target ="_blank "> < button class ='button button-outline '> WorkOS</ button > </ a >
21
+ </ div >
22
+ </ div >
23
+ < div class ='flex '>
24
+
25
+ < div class ="logged_in_div_right ">
26
+ < div class ="flex_column ">
27
+ < h2 > Group Details</ h2 >
28
+ < div >
29
+ < pre id ="noborder " class ="prettyprint noborder ">
30
+ {{group|tojson_pretty}}
31
+ </ pre >
32
+ </ div >
33
+ </ div >
34
+ </ div >
35
+ </ div >
36
+ < script src ="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js "> </ script >
37
+ </ body >
38
+
39
+ </ html >
Original file line number Diff line number Diff line change 4
4
< link rel ="stylesheet " href ="../static/home.css ">
5
5
</ head >
6
6
7
- < body class =" container_success " >
7
+ < body >
8
8
< div class ="logged_in_nav ">
9
9
< div class ="flex ">
10
10
< div >
25
25
26
26
< div class ="logged_in_div_right ">
27
27
< div class ="flex_column ">
28
- < div class ="flex space-between width-507px ">
28
+ < div class ="flex space-between width-40vw ">
29
29
< div >
30
30
< h2 > Groups Details</ h2 >
31
31
</ div >
@@ -36,15 +36,17 @@ <h2>Groups Details</h2>
36
36
</ div >
37
37
{% if groups['data']|length > 0 %}
38
38
< div >
39
- < table class ="width-507px ">
39
+ < table class ="width-40vw ">
40
40
< tr >
41
41
< th > Name</ th >
42
42
< th > ID</ th >
43
+ < th > View Group</ th >
43
44
</ tr >
44
45
{% for group in groups['data'] %}
45
46
< tr >
46
47
< td class ="ta-left "> {{group['name']}}</ td >
47
- < td class ="ta-left "> < code > {{group['id']}}</ code > </ td >
48
+ < td class ="ta-left "> < code > {{group['id']}}</ code > </ td >
49
+ < td > < a class ="button button-outline " href ="/group?id={{group['id']}} "> {{ lucide.icon('settings-2', stroke_width=1) }}</ a > </ td >
48
50
</ tr >
49
51
{% endfor %}
50
52
</ table >
Original file line number Diff line number Diff line change
1
+ < html >
2
+
3
+ < head >
4
+ < link rel ="stylesheet " href ="../static/home.css ">
5
+ </ head >
6
+
7
+ < body class ="container_success ">
8
+ < div class ="logged_in_nav ">
9
+ < div class ="flex ">
10
+ < div >
11
+ < img src ="../static/images/workos-logo-with-text.png " alt ="workos logo ">
12
+ </ div >
13
+ </ div >
14
+ < div >
15
+ < a href ="https://workos.com/docs " target ="_blank "> < button class ='button nav-item '> Documentation</ button > </ a >
16
+ < a href ="https://workos.com/docs/reference " target ="_blank "> < button class ='button nav-item '> API
17
+ Reference</ button > </ a >
18
+ < a href ="https://workos.com/blog " target ="_blank "> < button
19
+ class ='button nav-item blog-nav-button '> Blog</ button > </ a >
20
+ < a href ="https://workos.com/ " target ="_blank "> < button class ='button button-outline '> WorkOS</ button > </ a >
21
+ </ div >
22
+ </ div >
23
+ < div class ='flex '>
24
+
25
+ < div class ="logged_in_div_right ">
26
+ < div class ="flex_column ">
27
+ < h2 > User Details</ h2 >
28
+ < div >
29
+ < pre id ="noborder " class ="prettyprint noborder ">
30
+ {{user|tojson_pretty}}
31
+ </ pre >
32
+ </ div >
33
+ </ div >
34
+ </ div >
35
+ </ div >
36
+ < script src ="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js "> </ script >
37
+ </ body >
38
+
39
+ </ html >
Original file line number Diff line number Diff line change 4
4
< link rel ="stylesheet " href ="../static/home.css ">
5
5
</ head >
6
6
7
- < body class =" container_success " >
7
+ < body >
8
8
< div class ="logged_in_nav ">
9
9
< div class ="flex ">
10
10
< div >
23
23
< div class ='flex '>
24
24
< div class ="logged_in_div_right ">
25
25
< div class ="flex_column ">
26
- < div class ="flex space-between width-507px ">
26
+ < div class ="flex space-between width-40vw ">
27
27
< div >
28
- < h2 > User Details </ h2 >
28
+ < h2 > Directory Users </ h2 >
29
29
</ div >
30
30
< div >
31
31
< a href ="javascript:history.back() "> < button
@@ -34,15 +34,17 @@ <h2>User Details</h2>
34
34
</ div >
35
35
{% if users['data']|length > 0 %}
36
36
< div >
37
- < table class ="width-507px ">
37
+ < table class ="width-40vw ">
38
38
< tr >
39
39
< th > Name</ th >
40
40
< th > Email</ th >
41
+ < th > View User</ th >
41
42
</ tr >
42
43
{% for user in users['data'] %}
43
44
< tr >
44
45
< td class ="ta-left "> {{user['first_name']}} {{user['last_name']}}</ td >
45
- < td class ="ta-left "> < code > {{user['username']}}</ code > </ td >
46
+ < td class ="ta-left "> < code > {{user['username']}}</ code > </ td >
47
+ < td > < a class ="button button-outline " href ="/user?id={{user['id']}} "> {{ lucide.icon('settings-2', stroke_width=1) }}</ a > </ td >
46
48
</ tr >
47
49
{% endfor %}
48
50
</ table >
You can’t perform that action at this time.
0 commit comments