execreate
07/13/2022, 5:01 AMsupertokens-python==0.8.2
with Django==4.0.6
and resend code is not working for passwordless. Is it a known issue for python SDK version I am using?
It is a POST request from frontend to the URL signinup/code/resend
with preAuthSessionId
and deviceId
payload. The response says "status": "OK"
with 200 status, and the code is not being delivered. I cannot see any logs on the backend that indicate code resend attempt.execreate
07/13/2022, 5:03 AMsupertokens-core==v3.14.0
rp_st
07/13/2022, 5:48 AMKShivendu
07/13/2022, 5:49 AMexecreate
07/13/2022, 5:55 AMexecreate
07/13/2022, 5:57 AMpython
from supertokens_python import init, InputAppInfo, SupertokensConfig
from supertokens_python.recipe import passwordless, session
from supertokens_python.recipe.passwordless import ContactPhoneOnlyConfig
from apps.mysupertokens.otp_delivery import async_send_text_message
from apps.mysupertokens.overrides import override_functions
def init_supertokens(site_url,
website_domain,
website_base_path,
connection_uri,
api_key):
# ensure cookie domain is '.example.com' if api is hosted on a subdomain
cookie_domain = site_url.removeprefix("http://").removeprefix("https://")
if len(cookie_domain.split(".")) > 2:
cookie_domain = "." + ".".join(cookie_domain.split(".")[-2:])
init(
app_info=InputAppInfo(
app_name="medhub",
api_domain=site_url,
api_base_path="/auth",
website_domain=website_domain,
website_base_path=website_base_path,
),
supertokens_config=SupertokensConfig(
connection_uri=connection_uri,
api_key=api_key,
),
framework='django',
recipe_list=[
session.init(
override=session.InputOverrideConfig(functions=override_functions),
cookie_domain=cookie_domain,
),
passwordless.init(
flow_type="USER_INPUT_CODE",
contact_config=ContactPhoneOnlyConfig(
create_and_send_custom_text_message=async_send_text_message
)
)
],
mode='wsgi',
)
execreate
07/13/2022, 5:58 AMoverride_functions
override create_new_session
to ensure that access token contains user roles;rp_st
07/13/2022, 6:08 AMasync_send_text_message
function get called when you click on the resend button?execreate
07/13/2022, 6:11 AMrp_st
07/13/2022, 6:12 AMexecreate
07/13/2022, 6:12 AMexecreate
07/13/2022, 6:12 AMrp_st
07/13/2022, 6:12 AMrp_st
07/13/2022, 6:12 AMexecreate
07/13/2022, 6:13 AMexecreate
07/13/2022, 6:13 AMKShivendu
07/13/2022, 6:13 AMexecreate
07/13/2022, 8:25 AMsupertokens-python==0.10.1
🎉