Closed simonwiles closed 8 years ago
+1
+1, faced the same issue
for folks who came Googling here, looking into handling denied oauth flow for Google OAuth, you can use a basic Django 1.10 complaint middleware like this
from django.shortcuts import render_to_response
class MySocialAuthExceptionMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
if request.method == 'GET':
if 'access_denied' in request.META['QUERY_STRING']:
print "User has denied access"
return render_to_response('your_view.html')
response = self.get_response(request)
return response
+1
I just opened #1031 can you verify if it works for you?
MIDDLEWARE
setting.
If
social.apps.django_app.middleware.SocialAuthExceptionMiddleware
is added to Django 1.10's new (default)MIDDLEWARE
setting (as opposed toMIDDLEWARE_CLASSES
), Django will fail to start. Ideally the middleware should be updated (usingdjango.utils.deprecation.MiddlewareMixin
in the short-term), and the documentation should be updated too.Ref: https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-middleware