Skip to content

Commit 110ea50

Browse files
committed
adding dev-v0.18.3 tag to this commit to ensure building
1 parent f56a634 commit 110ea50

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

html/supertokens_python/constants.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
4242
from __future__ import annotations
4343

4444
SUPPORTED_CDI_VERSIONS = [&#34;3.0&#34;]
45-
VERSION = &#34;0.18.2&#34;
45+
VERSION = &#34;0.18.3&#34;
4646
TELEMETRY = &#34;/telemetry&#34;
4747
USER_COUNT = &#34;/users/count&#34;
4848
USER_DELETE = &#34;/user/remove&#34;

html/supertokens_python/framework/flask/flask_middleware.html

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ <h1 class="title">Module <code>supertokens_python.framework.flask.flask_middlewa
101101

102102
return response_.response
103103

104+
@app.teardown_request
105+
def _(_):
106+
from flask import g
107+
108+
if hasattr(g, &#34;supertokens&#34;):
109+
# this is to ensure there are no shared objects between requests.
110+
# calling any other API with a shared request causes a security issue, resulting in unintentional
111+
# sign-ins. More on this here - https://github.com/supertokens/supertokens-python/issues/463
112+
g.pop(&#34;supertokens&#34;)
113+
104114
def set_error_handler(self):
105115
app = self.app
106116
from supertokens_python.exceptions import SuperTokensError
@@ -203,6 +213,16 @@ <h2 class="section-title" id="header-classes">Classes</h2>
203213

204214
return response_.response
205215

216+
@app.teardown_request
217+
def _(_):
218+
from flask import g
219+
220+
if hasattr(g, &#34;supertokens&#34;):
221+
# this is to ensure there are no shared objects between requests.
222+
# calling any other API with a shared request causes a security issue, resulting in unintentional
223+
# sign-ins. More on this here - https://github.com/supertokens/supertokens-python/issues/463
224+
g.pop(&#34;supertokens&#34;)
225+
206226
def set_error_handler(self):
207227
app = self.app
208228
from supertokens_python.exceptions import SuperTokensError
@@ -288,7 +308,17 @@ <h3>Methods</h3>
288308
if hasattr(g, &#34;supertokens&#34;) and g.supertokens is not None:
289309
manage_session_post_response(g.supertokens, response_, {})
290310

291-
return response_.response</code></pre>
311+
return response_.response
312+
313+
@app.teardown_request
314+
def _(_):
315+
from flask import g
316+
317+
if hasattr(g, &#34;supertokens&#34;):
318+
# this is to ensure there are no shared objects between requests.
319+
# calling any other API with a shared request causes a security issue, resulting in unintentional
320+
# sign-ins. More on this here - https://github.com/supertokens/supertokens-python/issues/463
321+
g.pop(&#34;supertokens&#34;)</code></pre>
292322
</details>
293323
</dd>
294324
<dt id="supertokens_python.framework.flask.flask_middleware.Middleware.set_error_handler"><code class="name flex">

0 commit comments

Comments
 (0)