-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
verify_session() is not usable in Django Rest Framework #105
Comments
Hey @wolzenbug Try this: from supertokens_python.recipe.session.framework.django.syncio import verify_session
from django.utils.decorators import method_decorator
@method_decorator(verify_session(), name='dispatch')
class UserAPI(generics.RetrieveAPIView):
... |
Hey @KShivendu Thank you for your fast reply. Your proposed solution fixed the error! Now I face the following problem:
Looks like the request from my React (with axios and your interceptor) client to my DRF backend is missing some auth credentials. Do you have any information about how to send them appropriately? |
Well, the cookies should be added automatically if the config is done correctly. Here is a list of reasons on what could be wrong: supertokens/supertokens-website#68 I'm closing this issue since the last query is not related to the original comment. |
Cons of Using @method_decorator: |
Hey guys!
The support has asked me to create a ticket for this case. We agreed that this is not an issue with your SDK. We think it's because I was using the documented Django approach for the Django Rest Framework.
After decorating an example view with
verify_session()
like this:I was facing the following error:
Versions:
django =
3.2.11
djangorestframework =
3.12.4
supertokens-python =
0.6.1
To quote the support team (rp on discord):
I think that's the issue as well. We haven't designed the verify_session function to work in that way,. Though it would be nice if we would have done it the "django way". So we are investigating it. If you open an issue, you can keep track of the progress etc more easily.
The text was updated successfully, but these errors were encountered: