Skip to content

Commit

Permalink
Made Login route CSRF exempt
Browse files Browse the repository at this point in the history
  • Loading branch information
judtinzhang committed Mar 28, 2023
1 parent 308691d commit 3144fc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
from django.shortcuts import get_object_or_404, redirect
from django.urls import reverse
from django.utils import timezone
from django.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from requests_oauthlib import OAuth2Session

from accounts.models import AccessToken, RefreshToken
Expand Down Expand Up @@ -116,6 +118,7 @@ def get(self, request):
return redirect(return_to)


@method_decorator(csrf_exempt, name="dispatch")
class TokenView(View):
"""
View for token-based authentication, specifically for mobile products that
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-labs-accounts"
version = "0.9.1"
version = "0.9.2"
description = "Reusable Django app for Penn Labs accounts"
authors = ["Penn Labs <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 3144fc2

Please sign in to comment.