@@ -70,16 +70,16 @@ <h1 class="title">Module <code>supertokens_python.recipe.thirdparty.api.signinup
70
70
if third_party_id is None or not isinstance(third_party_id, str):
71
71
raise_bad_input_exception("Please provide the thirdPartyId in request body")
72
72
73
- redirect_uri_info = body.get("redirectURIInfo")
74
- oauth_tokens = body.get("oAuthTokens")
75
-
76
- if redirect_uri_info is not None:
77
- if redirect_uri_info.get("redirectURIOnProviderDashboard") is None:
73
+ oauth_tokens = None
74
+ redirect_uri_info = None
75
+ if body.get("redirectURIInfo") is not None:
76
+ if body.get("redirectURIInfo").get("redirectURIOnProviderDashboard") is None:
78
77
raise_bad_input_exception(
79
78
"Please provide the redirectURIOnProviderDashboard in request body"
80
79
)
81
- elif oauth_tokens is not None:
82
- pass # Nothing to do here
80
+ redirect_uri_info = body.get("redirectURIInfo")
81
+ elif body.get("oAuthTokens") is not None:
82
+ oauth_tokens = body.get("oAuthTokens")
83
83
else:
84
84
raise_bad_input_exception(
85
85
"Please provide one of redirectURIInfo or oAuthTokens in the request body"
@@ -99,15 +99,18 @@ <h1 class="title">Module <code>supertokens_python.recipe.thirdparty.api.signinup
99
99
100
100
provider = provider_response
101
101
102
- result = await api_implementation.sign_in_up_post(
103
- provider=provider,
104
- redirect_uri_info=RedirectUriInfo(
102
+ if redirect_uri_info is not None:
103
+ redirect_uri_info = RedirectUriInfo(
105
104
redirect_uri_on_provider_dashboard=redirect_uri_info.get(
106
105
"redirectURIOnProviderDashboard"
107
106
),
108
107
redirect_uri_query_params=redirect_uri_info.get("redirectURIQueryParams"),
109
108
pkce_code_verifier=redirect_uri_info.get("pkceCodeVerifier"),
110
- ),
109
+ )
110
+
111
+ result = await api_implementation.sign_in_up_post(
112
+ provider=provider,
113
+ redirect_uri_info=redirect_uri_info,
111
114
oauth_tokens=oauth_tokens,
112
115
tenant_id=tenant_id,
113
116
api_options=api_options,
@@ -151,16 +154,16 @@ <h2 class="section-title" id="header-functions">Functions</h2>
151
154
if third_party_id is None or not isinstance(third_party_id, str):
152
155
raise_bad_input_exception("Please provide the thirdPartyId in request body")
153
156
154
- redirect_uri_info = body.get("redirectURIInfo")
155
- oauth_tokens = body.get("oAuthTokens")
156
-
157
- if redirect_uri_info is not None:
158
- if redirect_uri_info.get("redirectURIOnProviderDashboard") is None:
157
+ oauth_tokens = None
158
+ redirect_uri_info = None
159
+ if body.get("redirectURIInfo") is not None:
160
+ if body.get("redirectURIInfo").get("redirectURIOnProviderDashboard") is None:
159
161
raise_bad_input_exception(
160
162
"Please provide the redirectURIOnProviderDashboard in request body"
161
163
)
162
- elif oauth_tokens is not None:
163
- pass # Nothing to do here
164
+ redirect_uri_info = body.get("redirectURIInfo")
165
+ elif body.get("oAuthTokens") is not None:
166
+ oauth_tokens = body.get("oAuthTokens")
164
167
else:
165
168
raise_bad_input_exception(
166
169
"Please provide one of redirectURIInfo or oAuthTokens in the request body"
@@ -180,15 +183,18 @@ <h2 class="section-title" id="header-functions">Functions</h2>
180
183
181
184
provider = provider_response
182
185
183
- result = await api_implementation.sign_in_up_post(
184
- provider=provider,
185
- redirect_uri_info=RedirectUriInfo(
186
+ if redirect_uri_info is not None:
187
+ redirect_uri_info = RedirectUriInfo(
186
188
redirect_uri_on_provider_dashboard=redirect_uri_info.get(
187
189
"redirectURIOnProviderDashboard"
188
190
),
189
191
redirect_uri_query_params=redirect_uri_info.get("redirectURIQueryParams"),
190
192
pkce_code_verifier=redirect_uri_info.get("pkceCodeVerifier"),
191
- ),
193
+ )
194
+
195
+ result = await api_implementation.sign_in_up_post(
196
+ provider=provider,
197
+ redirect_uri_info=redirect_uri_info,
192
198
oauth_tokens=oauth_tokens,
193
199
tenant_id=tenant_id,
194
200
api_options=api_options,
0 commit comments