Skip to content

Commit

Permalink
Correct example docs
Browse files Browse the repository at this point in the history
  • Loading branch information
funkybob committed Apr 28, 2018
1 parent 2f7e1b2 commit 5ae3b33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/examples.rst
Expand Up @@ -110,7 +110,7 @@ Login endpoint:
@classonlymethod
def as_view(cls, *args, **kwargs):
view = super().as_view(*args, **kwargs)
return ensure_csrf_token(view)
return ensure_csrf_cookie(view)
def get(self, request):
'''Returns the current user's details'''
Expand All @@ -126,7 +126,7 @@ Login endpoint:
return self.error_response(form.errors)
Note that it decorates `as_view` with `ensure_csrf_token`. This ensures the
Note that it decorates `as_view` with `ensure_csrf_cookie`. This ensures the
CSRF token is set if your site is a SPA.

You could even use the ``DELETE`` HTTP method for logout.
Expand Down

0 comments on commit 5ae3b33

Please sign in to comment.