-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for any type in value field instead of only string
- Loading branch information
1 parent
acf2184
commit d35914c
Showing
5 changed files
with
64 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -719,6 +719,48 @@ async def test_optional_custom_field_without_input(driver_config_client: TestCli | |
assert dict_response["status"] == "OK" | ||
|
||
|
||
@mark.asyncio | ||
async def test_non_optional_custom_field_with_boolean_value( | ||
driver_config_client: TestClient, | ||
): | ||
init( | ||
supertokens_config=SupertokensConfig("http://localhost:3567"), | ||
app_info=InputAppInfo( | ||
app_name="SuperTokens Demo", | ||
api_domain="http://api.supertokens.io", | ||
website_domain="http://supertokens.io", | ||
api_base_path="/auth", | ||
), | ||
framework="fastapi", | ||
recipe_list=[ | ||
emailpassword.init( | ||
sign_up_feature=emailpassword.InputSignUpFeature( | ||
form_fields=[ | ||
emailpassword.InputFormField("autoVerify", optional=False) | ||
] | ||
) | ||
), | ||
session.init(get_token_transfer_method=lambda _, __, ___: "cookie"), | ||
], | ||
) | ||
start_st() | ||
|
||
response_1 = driver_config_client.post( | ||
url="/auth/signup", | ||
headers={"Content-Type": "application/json"}, | ||
json={ | ||
"formFields": [ | ||
{"id": "email", "value": "[email protected]"}, | ||
{"id": "password", "value": "validpassword123"}, | ||
{"id": "autoVerify", "value": False}, | ||
] | ||
}, | ||
) | ||
assert response_1.status_code == 200 | ||
dict_response = json.loads(response_1.text) | ||
assert dict_response["status"] == "OK" | ||
|
||
|
||
@mark.asyncio | ||
async def test_too_many_fields(driver_config_client: TestClient): | ||
init( | ||
|