Source

django-publicauth / publicauth / backends / facebook.py

Diff from to

publicauth/backends/facebook.py

 from __future__ import absolute_import 
 
 from django.contrib import messages
+from django.conf import settings
 
 from annoying.exceptions import Redirect
 
     
     def validate(self, request, data):
         if not request.facebook.validate_cookie_signature(request.COOKIES):
-            messages.add_message(request, messages.ERROR, lang.FACEBOOK_INVALID_RESPONSE)
+            messages.error(request, lang.FACEBOOK_INVALID_RESPONSE)
             raise Redirect('publicauth-login')
         else:
             uid = request.facebook.api_key
             return request.facebook
 
     def complete(self, request, response):
+        request.session['next_url'] = request.GET.get("next") or settings.LOGIN_REDIRECT_URL
         data = self.fill_extra_fields(request, self.get_extra_data(response))
         request.session['extra'] = data
         request.session['identity'] = self.identity