Skip to content

Commit 3144fc2

Browse files
committed
Made Login route CSRF exempt
1 parent 308691d commit 3144fc2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

accounts/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
from django.shortcuts import get_object_or_404, redirect
88
from django.urls import reverse
99
from django.utils import timezone
10+
from django.utils.decorators import method_decorator
1011
from django.views import View
12+
from django.views.decorators.csrf import csrf_exempt
1113
from requests_oauthlib import OAuth2Session
1214

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

118120

121+
@method_decorator(csrf_exempt, name="dispatch")
119122
class TokenView(View):
120123
"""
121124
View for token-based authentication, specifically for mobile products that

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-labs-accounts"
3-
version = "0.9.1"
3+
version = "0.9.2"
44
description = "Reusable Django app for Penn Labs accounts"
55
authors = ["Penn Labs <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)