Skip to content

Commit f1b9103

Browse files
committed
adding dev-v0.27.0 tag to this commit to ensure building
1 parent 8f794c0 commit f1b9103

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+12829
-115
lines changed

html/supertokens_python/auth_utils.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ <h1 class="title">Module <code>supertokens_python.auth_utils</code></h1>
564564
if session_user_result.status == &#34;SHOULD_AUTOMATICALLY_LINK_FALSE&#34;:
565565
if should_try_linking_with_session_user is True:
566566
raise BadInputError(
567-
&#34;should_do_automatic_account_linking returned false when creating primary user but shouldTryLinkingWithSessionUser is true&#34;
567+
&#34;shouldDoAutomaticAccountLinking returned false when making the session user primary but shouldTryLinkingWithSessionUser is true&#34;
568568
)
569569
return OkFirstFactorResponse()
570570
elif (
@@ -593,7 +593,7 @@ <h1 class="title">Module <code>supertokens_python.auth_utils</code></h1>
593593
if isinstance(should_link, ShouldNotAutomaticallyLink):
594594
if should_try_linking_with_session_user is True:
595595
raise BadInputError(
596-
&#34;should_do_automatic_account_linking returned false when creating primary user but shouldTryLinkingWithSessionUser is true&#34;
596+
&#34;shouldDoAutomaticAccountLinking returned false when making the session user primary but shouldTryLinkingWithSessionUser is true&#34;
597597
)
598598
return OkFirstFactorResponse()
599599
else:

html/supertokens_python/constants.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
4242

4343
from __future__ import annotations
4444

45-
SUPPORTED_CDI_VERSIONS = [&#34;5.1&#34;]
46-
VERSION = &#34;0.26.1&#34;
45+
SUPPORTED_CDI_VERSIONS = [&#34;5.2&#34;]
46+
VERSION = &#34;0.27.0&#34;
4747
TELEMETRY = &#34;/telemetry&#34;
4848
USER_COUNT = &#34;/users/count&#34;
4949
USER_DELETE = &#34;/user/remove&#34;

html/supertokens_python/exceptions.html

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ <h3>Subclasses</h3>
161161
<li><a title="supertokens_python.recipe.emailverification.exceptions.SuperTokensEmailVerificationError" href="recipe/emailverification/exceptions.html#supertokens_python.recipe.emailverification.exceptions.SuperTokensEmailVerificationError">SuperTokensEmailVerificationError</a></li>
162162
<li><a title="supertokens_python.recipe.jwt.exceptions.SuperTokensJWTError" href="recipe/jwt/exceptions.html#supertokens_python.recipe.jwt.exceptions.SuperTokensJWTError">SuperTokensJWTError</a></li>
163163
<li><a title="supertokens_python.recipe.multitenancy.exceptions.MultitenancyError" href="recipe/multitenancy/exceptions.html#supertokens_python.recipe.multitenancy.exceptions.MultitenancyError">MultitenancyError</a></li>
164+
<li><a title="supertokens_python.recipe.oauth2provider.exceptions.OAuth2ProviderError" href="recipe/oauth2provider/exceptions.html#supertokens_python.recipe.oauth2provider.exceptions.OAuth2ProviderError">OAuth2ProviderError</a></li>
164165
<li><a title="supertokens_python.recipe.openid.exceptions.SuperTokensOpenIdError" href="recipe/openid/exceptions.html#supertokens_python.recipe.openid.exceptions.SuperTokensOpenIdError">SuperTokensOpenIdError</a></li>
165166
<li><a title="supertokens_python.recipe.passwordless.exceptions.SuperTokensPasswordlessError" href="recipe/passwordless/exceptions.html#supertokens_python.recipe.passwordless.exceptions.SuperTokensPasswordlessError">SuperTokensPasswordlessError</a></li>
166167
<li><a title="supertokens_python.recipe.session.exceptions.SuperTokensSessionError" href="recipe/session/exceptions.html#supertokens_python.recipe.session.exceptions.SuperTokensSessionError">SuperTokensSessionError</a></li>

html/supertokens_python/framework/django/django_request.html

+4
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ <h1 class="title">Module <code>supertokens_python.framework.django.django_reques
8585

8686
def get_header(self, key: str) -&gt; Union[None, str]:
8787
key = key.replace(&#34;-&#34;, &#34;_&#34;)
88+
if key.upper() in self.request.META:
89+
return self.request.META.get(key.upper())
8890
key = &#34;HTTP_&#34; + key
8991
return self.request.META.get(key.upper())
9092

@@ -173,6 +175,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
173175

174176
def get_header(self, key: str) -&gt; Union[None, str]:
175177
key = key.replace(&#34;-&#34;, &#34;_&#34;)
178+
if key.upper() in self.request.META:
179+
return self.request.META.get(key.upper())
176180
key = &#34;HTTP_&#34; + key
177181
return self.request.META.get(key.upper())
178182

html/supertokens_python/framework/django/django_response.html

+23-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,14 @@ <h1 class="title">Module <code>supertokens_python.framework.django.django_respon
115115
indent=None,
116116
separators=(&#34;,&#34;, &#34;:&#34;),
117117
).encode(&#34;utf-8&#34;)
118-
self.response_sent = True</code></pre>
118+
self.response_sent = True
119+
120+
def redirect(self, url: str) -&gt; BaseResponse:
121+
if not self.response_sent:
122+
self.set_header(&#34;Location&#34;, url)
123+
self.set_status_code(302)
124+
self.response_sent = True
125+
return self</code></pre>
119126
</details>
120127
</section>
121128
<section>
@@ -206,7 +213,14 @@ <h2 class="section-title" id="header-classes">Classes</h2>
206213
indent=None,
207214
separators=(&#34;,&#34;, &#34;:&#34;),
208215
).encode(&#34;utf-8&#34;)
209-
self.response_sent = True</code></pre>
216+
self.response_sent = True
217+
218+
def redirect(self, url: str) -&gt; BaseResponse:
219+
if not self.response_sent:
220+
self.set_header(&#34;Location&#34;, url)
221+
self.set_status_code(302)
222+
self.response_sent = True
223+
return self</code></pre>
210224
</details>
211225
<h3>Ancestors</h3>
212226
<ul class="hlist">
@@ -229,6 +243,12 @@ <h3>Methods</h3>
229243
<dd>
230244
<div class="desc"></div>
231245
</dd>
246+
<dt id="supertokens_python.framework.django.django_response.DjangoResponse.redirect"><code class="name flex">
247+
<span>def <span class="ident">redirect</span></span>(<span>self, url: str) ‑> <a title="supertokens_python.framework.response.BaseResponse" href="../response.html#supertokens_python.framework.response.BaseResponse">BaseResponse</a></span>
248+
</code></dt>
249+
<dd>
250+
<div class="desc"></div>
251+
</dd>
232252
<dt id="supertokens_python.framework.django.django_response.DjangoResponse.remove_header"><code class="name flex">
233253
<span>def <span class="ident">remove_header</span></span>(<span>self, key: str)</span>
234254
</code></dt>
@@ -288,6 +308,7 @@ <h4><code><a title="supertokens_python.framework.django.django_response.DjangoRe
288308
<ul class="two-column">
289309
<li><code><a title="supertokens_python.framework.django.django_response.DjangoResponse.HttpResponse" href="#supertokens_python.framework.django.django_response.DjangoResponse.HttpResponse">HttpResponse</a></code></li>
290310
<li><code><a title="supertokens_python.framework.django.django_response.DjangoResponse.get_header" href="#supertokens_python.framework.django.django_response.DjangoResponse.get_header">get_header</a></code></li>
311+
<li><code><a title="supertokens_python.framework.django.django_response.DjangoResponse.redirect" href="#supertokens_python.framework.django.django_response.DjangoResponse.redirect">redirect</a></code></li>
291312
<li><code><a title="supertokens_python.framework.django.django_response.DjangoResponse.remove_header" href="#supertokens_python.framework.django.django_response.DjangoResponse.remove_header">remove_header</a></code></li>
292313
<li><code><a title="supertokens_python.framework.django.django_response.DjangoResponse.set_cookie" href="#supertokens_python.framework.django.django_response.DjangoResponse.set_cookie">set_cookie</a></code></li>
293314
<li><code><a title="supertokens_python.framework.django.django_response.DjangoResponse.set_header" href="#supertokens_python.framework.django.django_response.DjangoResponse.set_header">set_header</a></code></li>

html/supertokens_python/framework/fastapi/fastapi_response.html

+23-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,14 @@ <h1 class="title">Module <code>supertokens_python.framework.fastapi.fastapi_resp
121121
self.set_header(&#34;Content-Type&#34;, &#34;application/json; charset=utf-8&#34;)
122122
self.set_header(&#34;Content-Length&#34;, str(len(body)))
123123
self.response.body = body
124-
self.response_sent = True</code></pre>
124+
self.response_sent = True
125+
126+
def redirect(self, url: str) -&gt; BaseResponse:
127+
if not self.response_sent:
128+
self.set_header(&#34;Location&#34;, url)
129+
self.set_status_code(302)
130+
self.response_sent = True
131+
return self</code></pre>
125132
</details>
126133
</section>
127134
<section>
@@ -218,7 +225,14 @@ <h2 class="section-title" id="header-classes">Classes</h2>
218225
self.set_header(&#34;Content-Type&#34;, &#34;application/json; charset=utf-8&#34;)
219226
self.set_header(&#34;Content-Length&#34;, str(len(body)))
220227
self.response.body = body
221-
self.response_sent = True</code></pre>
228+
self.response_sent = True
229+
230+
def redirect(self, url: str) -&gt; BaseResponse:
231+
if not self.response_sent:
232+
self.set_header(&#34;Location&#34;, url)
233+
self.set_status_code(302)
234+
self.response_sent = True
235+
return self</code></pre>
222236
</details>
223237
<h3>Ancestors</h3>
224238
<ul class="hlist">
@@ -240,6 +254,12 @@ <h3>Methods</h3>
240254
<dd>
241255
<div class="desc"></div>
242256
</dd>
257+
<dt id="supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.redirect"><code class="name flex">
258+
<span>def <span class="ident">redirect</span></span>(<span>self, url: str) ‑> <a title="supertokens_python.framework.response.BaseResponse" href="../response.html#supertokens_python.framework.response.BaseResponse">BaseResponse</a></span>
259+
</code></dt>
260+
<dd>
261+
<div class="desc"></div>
262+
</dd>
243263
<dt id="supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.remove_header"><code class="name flex">
244264
<span>def <span class="ident">remove_header</span></span>(<span>self, key: str)</span>
245265
</code></dt>
@@ -299,6 +319,7 @@ <h4><code><a title="supertokens_python.framework.fastapi.fastapi_response.FastAp
299319
<ul class="two-column">
300320
<li><code><a title="supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.Response" href="#supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.Response">Response</a></code></li>
301321
<li><code><a title="supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.get_header" href="#supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.get_header">get_header</a></code></li>
322+
<li><code><a title="supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.redirect" href="#supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.redirect">redirect</a></code></li>
302323
<li><code><a title="supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.remove_header" href="#supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.remove_header">remove_header</a></code></li>
303324
<li><code><a title="supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.set_cookie" href="#supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.set_cookie">set_cookie</a></code></li>
304325
<li><code><a title="supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.set_header" href="#supertokens_python.framework.fastapi.fastapi_response.FastApiResponse.set_header">set_header</a></code></li>

html/supertokens_python/framework/flask/flask_response.html

+23-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,14 @@ <h1 class="title">Module <code>supertokens_python.framework.flask.flask_response
112112
indent=None,
113113
separators=(&#34;,&#34;, &#34;:&#34;),
114114
).encode(&#34;utf-8&#34;)
115-
self.response_sent = True</code></pre>
115+
self.response_sent = True
116+
117+
def redirect(self, url: str) -&gt; BaseResponse:
118+
self.set_header(&#34;Location&#34;, url)
119+
self.set_status_code(302)
120+
self.response.data = b&#34;&#34;
121+
self.response_sent = True
122+
return self</code></pre>
116123
</details>
117124
</section>
118125
<section>
@@ -202,7 +209,14 @@ <h2 class="section-title" id="header-classes">Classes</h2>
202209
indent=None,
203210
separators=(&#34;,&#34;, &#34;:&#34;),
204211
).encode(&#34;utf-8&#34;)
205-
self.response_sent = True</code></pre>
212+
self.response_sent = True
213+
214+
def redirect(self, url: str) -&gt; BaseResponse:
215+
self.set_header(&#34;Location&#34;, url)
216+
self.set_status_code(302)
217+
self.response.data = b&#34;&#34;
218+
self.response_sent = True
219+
return self</code></pre>
206220
</details>
207221
<h3>Ancestors</h3>
208222
<ul class="hlist">
@@ -246,6 +260,12 @@ <h3>Methods</h3>
246260
<dd>
247261
<div class="desc"></div>
248262
</dd>
263+
<dt id="supertokens_python.framework.flask.flask_response.FlaskResponse.redirect"><code class="name flex">
264+
<span>def <span class="ident">redirect</span></span>(<span>self, url: str) ‑> <a title="supertokens_python.framework.response.BaseResponse" href="../response.html#supertokens_python.framework.response.BaseResponse">BaseResponse</a></span>
265+
</code></dt>
266+
<dd>
267+
<div class="desc"></div>
268+
</dd>
249269
<dt id="supertokens_python.framework.flask.flask_response.FlaskResponse.remove_header"><code class="name flex">
250270
<span>def <span class="ident">remove_header</span></span>(<span>self, key: str)</span>
251271
</code></dt>
@@ -306,6 +326,7 @@ <h4><code><a title="supertokens_python.framework.flask.flask_response.FlaskRespo
306326
<li><code><a title="supertokens_python.framework.flask.flask_response.FlaskResponse.Response" href="#supertokens_python.framework.flask.flask_response.FlaskResponse.Response">Response</a></code></li>
307327
<li><code><a title="supertokens_python.framework.flask.flask_response.FlaskResponse.get_header" href="#supertokens_python.framework.flask.flask_response.FlaskResponse.get_header">get_header</a></code></li>
308328
<li><code><a title="supertokens_python.framework.flask.flask_response.FlaskResponse.get_headers" href="#supertokens_python.framework.flask.flask_response.FlaskResponse.get_headers">get_headers</a></code></li>
329+
<li><code><a title="supertokens_python.framework.flask.flask_response.FlaskResponse.redirect" href="#supertokens_python.framework.flask.flask_response.FlaskResponse.redirect">redirect</a></code></li>
309330
<li><code><a title="supertokens_python.framework.flask.flask_response.FlaskResponse.remove_header" href="#supertokens_python.framework.flask.flask_response.FlaskResponse.remove_header">remove_header</a></code></li>
310331
<li><code><a title="supertokens_python.framework.flask.flask_response.FlaskResponse.set_cookie" href="#supertokens_python.framework.flask.flask_response.FlaskResponse.set_cookie">set_cookie</a></code></li>
311332
<li><code><a title="supertokens_python.framework.flask.flask_response.FlaskResponse.set_header" href="#supertokens_python.framework.flask.flask_response.FlaskResponse.set_header">set_header</a></code></li>

html/supertokens_python/framework/request.html

+24-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ <h1 class="title">Module <code>supertokens_python.framework.request</code></h1>
7575
async def form_data(self) -&gt; Dict[str, Any]:
7676
pass
7777

78+
async def get_json_or_form_data(self) -&gt; Union[Dict[str, Any], None]:
79+
content_type = self.get_header(&#34;Content-Type&#34;)
80+
if content_type is None:
81+
return None
82+
if content_type.startswith(&#34;application/json&#34;):
83+
return await self.json()
84+
return await self.form_data()
85+
7886
@abstractmethod
7987
def method(self) -&gt; str:
8088
pass
@@ -153,6 +161,14 @@ <h2 class="section-title" id="header-classes">Classes</h2>
153161
async def form_data(self) -&gt; Dict[str, Any]:
154162
pass
155163

164+
async def get_json_or_form_data(self) -&gt; Union[Dict[str, Any], None]:
165+
content_type = self.get_header(&#34;Content-Type&#34;)
166+
if content_type is None:
167+
return None
168+
if content_type.startswith(&#34;application/json&#34;):
169+
return await self.json()
170+
return await self.form_data()
171+
156172
@abstractmethod
157173
def method(self) -&gt; str:
158174
pass
@@ -214,6 +230,12 @@ <h3>Methods</h3>
214230
<dd>
215231
<div class="desc"></div>
216232
</dd>
233+
<dt id="supertokens_python.framework.request.BaseRequest.get_json_or_form_data"><code class="name flex">
234+
<span>async def <span class="ident">get_json_or_form_data</span></span>(<span>self) ‑> Optional[Dict[str, Any]]</span>
235+
</code></dt>
236+
<dd>
237+
<div class="desc"></div>
238+
</dd>
217239
<dt id="supertokens_python.framework.request.BaseRequest.get_original_url"><code class="name flex">
218240
<span>def <span class="ident">get_original_url</span></span>(<span>self) ‑> str</span>
219241
</code></dt>
@@ -289,10 +311,11 @@ <h2>Index</h2>
289311
<ul>
290312
<li>
291313
<h4><code><a title="supertokens_python.framework.request.BaseRequest" href="#supertokens_python.framework.request.BaseRequest">BaseRequest</a></code></h4>
292-
<ul class="two-column">
314+
<ul class="">
293315
<li><code><a title="supertokens_python.framework.request.BaseRequest.form_data" href="#supertokens_python.framework.request.BaseRequest.form_data">form_data</a></code></li>
294316
<li><code><a title="supertokens_python.framework.request.BaseRequest.get_cookie" href="#supertokens_python.framework.request.BaseRequest.get_cookie">get_cookie</a></code></li>
295317
<li><code><a title="supertokens_python.framework.request.BaseRequest.get_header" href="#supertokens_python.framework.request.BaseRequest.get_header">get_header</a></code></li>
318+
<li><code><a title="supertokens_python.framework.request.BaseRequest.get_json_or_form_data" href="#supertokens_python.framework.request.BaseRequest.get_json_or_form_data">get_json_or_form_data</a></code></li>
296319
<li><code><a title="supertokens_python.framework.request.BaseRequest.get_original_url" href="#supertokens_python.framework.request.BaseRequest.get_original_url">get_original_url</a></code></li>
297320
<li><code><a title="supertokens_python.framework.request.BaseRequest.get_path" href="#supertokens_python.framework.request.BaseRequest.get_path">get_path</a></code></li>
298321
<li><code><a title="supertokens_python.framework.request.BaseRequest.get_query_param" href="#supertokens_python.framework.request.BaseRequest.get_query_param">get_query_param</a></code></li>

html/supertokens_python/framework/response.html

+15
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ <h1 class="title">Module <code>supertokens_python.framework.response</code></h1>
8888

8989
@abstractmethod
9090
def set_html_content(self, content: str):
91+
pass
92+
93+
@abstractmethod
94+
def redirect(self, url: str) -&gt; &#34;BaseResponse&#34;:
9195
pass</code></pre>
9296
</details>
9397
</section>
@@ -155,6 +159,10 @@ <h2 class="section-title" id="header-classes">Classes</h2>
155159

156160
@abstractmethod
157161
def set_html_content(self, content: str):
162+
pass
163+
164+
@abstractmethod
165+
def redirect(self, url: str) -&gt; &#34;BaseResponse&#34;:
158166
pass</code></pre>
159167
</details>
160168
<h3>Ancestors</h3>
@@ -175,6 +183,12 @@ <h3>Methods</h3>
175183
<dd>
176184
<div class="desc"></div>
177185
</dd>
186+
<dt id="supertokens_python.framework.response.BaseResponse.redirect"><code class="name flex">
187+
<span>def <span class="ident">redirect</span></span>(<span>self, url: str) ‑> <a title="supertokens_python.framework.response.BaseResponse" href="#supertokens_python.framework.response.BaseResponse">BaseResponse</a></span>
188+
</code></dt>
189+
<dd>
190+
<div class="desc"></div>
191+
</dd>
178192
<dt id="supertokens_python.framework.response.BaseResponse.remove_header"><code class="name flex">
179193
<span>def <span class="ident">remove_header</span></span>(<span>self, key: str) ‑> None</span>
180194
</code></dt>
@@ -233,6 +247,7 @@ <h2>Index</h2>
233247
<h4><code><a title="supertokens_python.framework.response.BaseResponse" href="#supertokens_python.framework.response.BaseResponse">BaseResponse</a></code></h4>
234248
<ul class="two-column">
235249
<li><code><a title="supertokens_python.framework.response.BaseResponse.get_header" href="#supertokens_python.framework.response.BaseResponse.get_header">get_header</a></code></li>
250+
<li><code><a title="supertokens_python.framework.response.BaseResponse.redirect" href="#supertokens_python.framework.response.BaseResponse.redirect">redirect</a></code></li>
236251
<li><code><a title="supertokens_python.framework.response.BaseResponse.remove_header" href="#supertokens_python.framework.response.BaseResponse.remove_header">remove_header</a></code></li>
237252
<li><code><a title="supertokens_python.framework.response.BaseResponse.set_cookie" href="#supertokens_python.framework.response.BaseResponse.set_cookie">set_cookie</a></code></li>
238253
<li><code><a title="supertokens_python.framework.response.BaseResponse.set_header" href="#supertokens_python.framework.response.BaseResponse.set_header">set_header</a></code></li>

0 commit comments

Comments
 (0)