Hi, I'm experiencing a problem with the get_user_by_id method from supertokens_python.recipe.thirdpa...
d
Hi, I'm experiencing a problem with the get_user_by_id method from supertokens_python.recipe.thirdparty.syncio. When I access this API route, I get the error message "Initialisation not done. Did you forget to call Supertokens.init". But the rest of the app is working fine (also with login/ logout etc., acccessing the session). Is there something I need to change for the API view?
Copy code
@method_decorator(verify_session(), name='dispatch')
class UserIsThirdParty(APIView):

    def get(self, request: HttpRequest):
        session: SessionContainer = request.supertokens

        user_id = session.get_user_id()

        user = get_user_by_id(user_id)
        ...
I'm currently initialising the Supertokens instance in my settings.py
r
which recipes have you init on the backend?
d
session, dashboard, usermetadata, thirdpartyemailpassword, emailverification
r
right. So the function
get_user_by_id
should be imported from
supertokens_python.recipe.thirdpartyemailpassword.syncio
d
Thank you! Works now. Maybe this could be added to the docs
18 Views