Hi there, I’ve got a question around recipe user id usage for email verification please as I’m not s...
d

david_61794

over 1 year ago
Hi there, I’ve got a question around recipe user id usage for email verification please as I’m not sure if there is a bug in
getUser
or I just don’t understand how user id mapping is supposed to work between recipe user ids and external ids. Currently we’re mapping our users to an external id with
createUserIdMapping
after signing them up. We then verify their emails using the external id as it’s the id returned by calling
getUser
. Once the email is verified, a row is added to
emailverification_verified_emails
with the external user id as the
user_id
in the database. This works well as the email verification claim
st-ev
is
true
in the access token jwt and if I call
isEmailVerified
with the external user id converted to a recipe user id then it returns true.
The problem seems to be with
getUser
as it returns a list of
loginMethods
but the
verified
flag is false even though
isEmailVerified
returns true if I check using the same
recipeUserId
and email returned in the login method. The email verification claim for this user is
true
in the access token too. However if I change the logic to verify the email based on the supertokens user id instead, then
getUser
will return the login method
verified
as true but the email verification claim
st-ev
is false. I may be misunderstanding how the different ids are supposed to be used but it seems like
getUser
may be returning the verification status of the email login method incorrectly please?
Hey, I've this error Please advise Using Flask, with SQLAlchemy ``` /usr/local/lib/python3.9/site-pa...
a

amagic5502

almost 2 years ago
Hey, I've this error Please advise Using Flask, with SQLAlchemy
/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/context.py:2695: RuntimeWarning: coroutine 'Supertokens.middleware' was never awaited
  _instance = loading._instance_processor(
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
ERROR:APP_NAME:Exception on /case/ [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask_cors/extension.py", line 176, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1482, in full_dispatch_request
    rv = self.preprocess_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1974, in preprocess_request
    rv = self.ensure_sync(before_func)()
  File "/usr/local/lib/python3.9/site-packages/supertokens_python/framework/flask/flask_middleware.py", line 54, in _
    result: Union[BaseResponse, None] = sync(st.middleware(request_, response_))
  File "/usr/local/lib/python3.9/site-packages/supertokens_python/async_to_sync_wrapper.py", line 33, in sync
    return loop.run_until_complete(co)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 623, in run_until_complete
    self._check_running()
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 583, in _check_running
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running