@@ -34,7 +34,22 @@ def choose_api():
3434
3535@ds .route ("/api_selected" , methods = ["GET" , "POST" ])
3636def api_selected ():
37- session ["chosen_api" ] = request .form .get ("chosen_api" )
37+ chosen_api = request .form .get ("chosen_api" )
38+
39+ if chosen_api == "ESignature" :
40+ EXAMPLES_API_TYPE ["ESignature" ] = True
41+ elif chosen_api == "Rooms" :
42+ EXAMPLES_API_TYPE ["Rooms" ] = True
43+ elif chosen_api == "Admin" :
44+ EXAMPLES_API_TYPE ["Admin" ] = True
45+ elif chosen_api == "Monitor" :
46+ EXAMPLES_API_TYPE ["Monitor" ] = True
47+ elif chosen_api == "Click" :
48+ EXAMPLES_API_TYPE ["Click" ] = True
49+
50+ session ["chosen_api" ] = False
51+ session ["chosen_api" ] = chosen_api
52+
3853 ds_logout_internal ()
3954 flash ("You have logged out from DocuSign." )
4055 app .config ["isLoggedIn" ] = False
@@ -91,11 +106,11 @@ def ds_callback():
91106
92107@ds .route ("/must_authenticate" )
93108def ds_must_authenticate ():
94- if DS_CONFIG ["quickstart" ] == "true" and session [ "chosen_api" ] == "e_signature" :
109+ if DS_CONFIG ["quickstart" ] == "true" and EXAMPLES_API_TYPE [ "ESignature" ] :
95110 session ["auth_type" ] = "code_grant"
96111 return redirect (url_for ("ds.ds_login" ))
97112
98- elif session [ "chosen_api" ] == "monitor" :
113+ elif EXAMPLES_API_TYPE [ "Monitor" ] :
99114 session ["auth_type" ] = "jwt"
100115 return redirect (url_for ("ds.ds_login" ))
101116
0 commit comments