summaryrefslogtreecommitdiffstats
path: root/django_authopenid/middleware.py
diff options
context:
space:
mode:
Diffstat (limited to 'django_authopenid/middleware.py')
-rw-r--r--django_authopenid/middleware.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django_authopenid/middleware.py b/django_authopenid/middleware.py
index 2900d54c..2be8da90 100644
--- a/django_authopenid/middleware.py
+++ b/django_authopenid/middleware.py
@@ -2,6 +2,8 @@
from django_authopenid import mimeparse
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
+from django.conf import settings
+import logging
__all__ = ["OpenIDMiddleware"]
@@ -12,6 +14,7 @@ class OpenIDMiddleware(object):
"""
def process_request(self, request):
request.openid = request.session.get('openid', None)
+ logging.debug('openid in session is: %s' % str(request.openid))
def process_response(self, request, response):
if response.status_code != 200 or len(response.content) < 200:
@@ -20,5 +23,6 @@ class OpenIDMiddleware(object):
if path == "/" and request.META.has_key('HTTP_ACCEPT') and \
mimeparse.best_match(['text/html', 'application/xrds+xml'],
request.META['HTTP_ACCEPT']) == 'application/xrds+xml':
+ logging.debug('redirecting to yadis_xrdf:%s' % reverse('yadis_xrdf'))
return HttpResponseRedirect(reverse('yadis_xrdf'))
return response