@@ -42,16 +42,16 @@ async def handle_sign_in_up_api(
42
42
if third_party_id is None or not isinstance (third_party_id , str ):
43
43
raise_bad_input_exception ("Please provide the thirdPartyId in request body" )
44
44
45
- redirect_uri_info = body .get ("redirectURIInfo" )
46
- oauth_tokens = body .get ("oAuthTokens" )
47
-
48
- if redirect_uri_info is not None :
49
- if redirect_uri_info .get ("redirectURIOnProviderDashboard" ) is None :
45
+ oauth_tokens = None
46
+ redirect_uri_info = None
47
+ if body .get ("redirectURIInfo" ) is not None :
48
+ if body .get ("redirectURIInfo" ).get ("redirectURIOnProviderDashboard" ) is None :
50
49
raise_bad_input_exception (
51
50
"Please provide the redirectURIOnProviderDashboard in request body"
52
51
)
53
- elif oauth_tokens is not None :
54
- pass # Nothing to do here
52
+ redirect_uri_info = body .get ("redirectURIInfo" )
53
+ elif body .get ("oAuthTokens" ) is not None :
54
+ oauth_tokens = body .get ("oAuthTokens" )
55
55
else :
56
56
raise_bad_input_exception (
57
57
"Please provide one of redirectURIInfo or oAuthTokens in the request body"
@@ -71,15 +71,18 @@ async def handle_sign_in_up_api(
71
71
72
72
provider = provider_response
73
73
74
- result = await api_implementation .sign_in_up_post (
75
- provider = provider ,
76
- redirect_uri_info = RedirectUriInfo (
74
+ if redirect_uri_info is not None :
75
+ redirect_uri_info = RedirectUriInfo (
77
76
redirect_uri_on_provider_dashboard = redirect_uri_info .get (
78
77
"redirectURIOnProviderDashboard"
79
78
),
80
79
redirect_uri_query_params = redirect_uri_info .get ("redirectURIQueryParams" ),
81
80
pkce_code_verifier = redirect_uri_info .get ("pkceCodeVerifier" ),
82
- ),
81
+ )
82
+
83
+ result = await api_implementation .sign_in_up_post (
84
+ provider = provider ,
85
+ redirect_uri_info = redirect_uri_info ,
83
86
oauth_tokens = oauth_tokens ,
84
87
tenant_id = tenant_id ,
85
88
api_options = api_options ,
0 commit comments