def logout(request): from django.contrib.auth import logout from openid_consumer.views import signout as oid_signout oid_signout(request) logout(request) redirect_to = request.REQUEST.get(auth.REDIRECT_FIELD_NAME, LOGOUT_REDIRECT_URL) return redirect(redirect_to)
def social_logout(request): # Todo # still need to handle FB cookies, session etc. # let the openid_consumer app handle openid-related cleanup from openid_consumer.views import signout as oid_signout oid_signout(request) # normal logout logout_response = logout(request) if getattr(settings, 'LOGOUT_REDIRECT_URL', None): return HttpResponseRedirect(settings.LOGOUT_REDIRECT_URL) else: return logout_response
def social_logout(request): # TODO: handle FB cookies, session etc. # let the openid_consumer app handle openid-related cleanup from openid_consumer.views import signout as oid_signout oid_signout(request) # normal logout logout_response = logout(request) if 'next' in request.GET: response = HttpResponseRedirect(request.GET.get('next')) elif LOGOUT_REDIRECT_URL: response = HttpResponseRedirect(LOGOUT_REDIRECT_URL) else: response = logout_response for provider in SOCIALAUTH_PROVIDERS_MAP.values(): provider().logout(request, response) return response
def social_logout(request): # TODO: handle FB cookies, session etc. # let the openid_consumer app handle openid-related cleanup from openid_consumer.views import signout as oid_signout oid_signout(request) # normal logout logout_response = logout(request) if 'next' in request.GET: response = HttpResponseRedirect(request.GET.get('next')) elif LOGOUT_REDIRECT_URL: response = HttpResponseRedirect(LOGOUT_REDIRECT_URL) else: response = logout_response # Delete the facebook cookie response.delete_cookie("fbs_" + FACEBOOK_APP_ID) return response
def social_logout(request): # Todo # still need to handle FB cookies, session etc. # let the openid_consumer app handle openid-related cleanup from openid_consumer.views import signout as oid_signout oid_signout(request) # normal logout logout_response = logout(request) if 'next' in request.GET: response = HttpResponseRedirect(request.GET.get('next')) elif getattr(settings, 'LOGOUT_REDIRECT_URL', None): response = HttpResponseRedirect(settings.LOGOUT_REDIRECT_URL) else: response = logout_response # Delete the facebook cookie response.delete_cookie("fbs_" + FACEBOOK_APP_ID) return response