Skip to content

Commit

Permalink
potential support for next query string argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarbaugh committed Oct 29, 2010
1 parent 213308e commit e4a487a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions googleauth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def login(request):

request.session['login_referer'] = request.META.get('HTTP_REFERER', None)
request.session['next'] = request.META.get('HTTP_REFERER', None)

openid_consumer = Consumer(request.session, None)

Expand Down Expand Up @@ -63,8 +63,9 @@ def callback(request):
return HttpResponseServerError('user account not found')
auth.login(request, user)

redirect = request.session.get('login_referer', None)
return HttpResponseRedirect(redirect or '/')
redirect = request.session.get('next', None)
redirect_default = getattr(settings, 'LOGIN_REDIRECT_URL', '/')
return HttpResponseRedirect(redirect or redirect_default)

def logout(request):
return django_logout(request)

0 comments on commit e4a487a

Please sign in to comment.