justquick / django-activity-stream

Generate generic activity streams from the actions on your site. Users can follow any actors' activities for personalized streams.
http://django-activity-stream.rtfd.io/en/latest/
BSD 3-Clause "New" or "Revised" License
2.36k stars 483 forks source link

Authentication issues #491

Closed suprmat95 closed 2 years ago

suprmat95 commented 3 years ago

I am developing a web and mobile application in which I use session authentication.

I would like to test all endpoints but some of them are protected by the @login_required and @csrf_exempt decorators.

For example when I try to do GET http://localhost:8000/activity/follow// the login form appears and after login an error appears about the csrf. Do you how I can solve this issue?

image

image

justquick commented 2 years ago

looks like you are using token auth with drf. token auth doesnt work well w/ csrf. you can subclass the view and use the @csrf_excempt decorator (with caution) or find another way around it

https://stackoverflow.com/questions/30871033/django-rest-framework-remove-csrf