Skip to content

Commit e210b2c

Browse files
committed
adding dev-v0.11.10 tag to this commit to ensure building
1 parent e6cd497 commit e210b2c

File tree

3 files changed

+41
-7
lines changed

3 files changed

+41
-7
lines changed

html/supertokens_python/constants.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
4040
# License for the specific language governing permissions and limitations
4141
# under the License.
4242
SUPPORTED_CDI_VERSIONS = [&#34;2.9&#34;, &#34;2.10&#34;, &#34;2.11&#34;, &#34;2.12&#34;, &#34;2.13&#34;, &#34;2.14&#34;, &#34;2.15&#34;]
43-
VERSION = &#34;0.11.9&#34;
43+
VERSION = &#34;0.11.10&#34;
4444
TELEMETRY = &#34;/telemetry&#34;
4545
USER_COUNT = &#34;/users/count&#34;
4646
USER_DELETE = &#34;/user/remove&#34;

html/supertokens_python/recipe/emailpassword/api/signup.html

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ <h1 class="title">Module <code>supertokens_python.recipe.emailpassword.api.signu
4343

4444
from typing import TYPE_CHECKING, Any
4545

46+
from ..exceptions import raise_form_field_exception
47+
from supertokens_python.recipe.emailpassword.interfaces import (
48+
SignUpOkResult,
49+
SignUpPostEmailAlreadyExistsError,
50+
)
51+
from supertokens_python.types import GeneralErrorResponse
52+
from ..types import ErrorFormField
53+
4654
if TYPE_CHECKING:
4755
from supertokens_python.recipe.emailpassword.interfaces import (
4856
APIOptions,
@@ -71,7 +79,20 @@ <h1 class="title">Module <code>supertokens_python.recipe.emailpassword.api.signu
7179
form_fields, api_options, user_context
7280
)
7381

74-
return send_200_response(response.to_json(), api_options.response)</code></pre>
82+
if isinstance(response, SignUpOkResult):
83+
return send_200_response(response.to_json(), api_options.response)
84+
if isinstance(response, GeneralErrorResponse):
85+
return send_200_response(response.to_json(), api_options.response)
86+
if isinstance(response, SignUpPostEmailAlreadyExistsError):
87+
return raise_form_field_exception(
88+
&#34;EMAIL_ALREADY_EXISTS_ERROR&#34;,
89+
[
90+
ErrorFormField(
91+
id=&#34;email&#34;,
92+
error=&#34;This email already exists. Please sign in instead.&#34;,
93+
)
94+
],
95+
)</code></pre>
7596
</details>
7697
</section>
7798
<section>
@@ -106,7 +127,20 @@ <h2 class="section-title" id="header-functions">Functions</h2>
106127
form_fields, api_options, user_context
107128
)
108129

109-
return send_200_response(response.to_json(), api_options.response)</code></pre>
130+
if isinstance(response, SignUpOkResult):
131+
return send_200_response(response.to_json(), api_options.response)
132+
if isinstance(response, GeneralErrorResponse):
133+
return send_200_response(response.to_json(), api_options.response)
134+
if isinstance(response, SignUpPostEmailAlreadyExistsError):
135+
return raise_form_field_exception(
136+
&#34;EMAIL_ALREADY_EXISTS_ERROR&#34;,
137+
[
138+
ErrorFormField(
139+
id=&#34;email&#34;,
140+
error=&#34;This email already exists. Please sign in instead.&#34;,
141+
)
142+
],
143+
)</code></pre>
110144
</details>
111145
</dd>
112146
</dl>

html/supertokens_python/recipe/emailpassword/exceptions.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ <h1 class="title">Module <code>supertokens_python.recipe.emailpassword.exception
4141
# under the License.
4242
from __future__ import annotations
4343

44-
from typing import TYPE_CHECKING, Any, Dict, List
44+
from typing import TYPE_CHECKING, Any, Dict, List, NoReturn
4545

4646
from supertokens_python.exceptions import SuperTokensError
4747

4848
if TYPE_CHECKING:
4949
from .types import ErrorFormField
5050

5151

52-
def raise_form_field_exception(msg: str, form_fields: List[ErrorFormField]):
52+
def raise_form_field_exception(msg: str, form_fields: List[ErrorFormField]) -&gt; NoReturn:
5353
raise FieldError(msg, form_fields)
5454

5555

@@ -77,15 +77,15 @@ <h1 class="title">Module <code>supertokens_python.recipe.emailpassword.exception
7777
<h2 class="section-title" id="header-functions">Functions</h2>
7878
<dl>
7979
<dt id="supertokens_python.recipe.emailpassword.exceptions.raise_form_field_exception"><code class="name flex">
80-
<span>def <span class="ident">raise_form_field_exception</span></span>(<span>msg: str, form_fields: List[ErrorFormField])</span>
80+
<span>def <span class="ident">raise_form_field_exception</span></span>(<span>msg: str, form_fields: List[ErrorFormField])> NoReturn</span>
8181
</code></dt>
8282
<dd>
8383
<div class="desc"></div>
8484
<details class="source">
8585
<summary>
8686
<span>Expand source code</span>
8787
</summary>
88-
<pre><code class="python">def raise_form_field_exception(msg: str, form_fields: List[ErrorFormField]):
88+
<pre><code class="python">def raise_form_field_exception(msg: str, form_fields: List[ErrorFormField]) -&gt; NoReturn:
8989
raise FieldError(msg, form_fields)</code></pre>
9090
</details>
9191
</dd>

0 commit comments

Comments
 (0)