def api_v1_logout(request): django_logout(request) message='looged out successfully' data={'message':message} #return HttpResponseRedirect('/api/v2/login/') data = simplejson.dumps(data) return HttpResponse(data, mimetype='application/json')
def logout(request,context=None): django_logout(request) dajax = Dajax() msg = _('You are now disconnected.') messages.add_message(request, messages.INFO, unicode(msg) ) dajax.script('location.reload()') return dajax.json()
def logout(request, redirect_url=settings.LOGOUT_REDIRECT_URL): """ Nothing hilariously hidden here, logs a user out. Strip this out if your application already has hooks to handle this. """ django_logout(request) return HttpResponseRedirect(request.build_absolute_uri(redirect_url))
def logout_user(request): signals.on_before_logout.send(None, request=request) django_logout(request) request.session.flush() request.session[accounts_settings.SESSION_FIRST_TIME_VISIT_VISITED_KEY] = True
def user_logout(request): """ Logs the currently logged-in user out. """ django_logout(request) request.session.flush() return HttpResponseRedirect(reverse('home:index', args=()))
def session(request): """ This function creates a user with no password set. This enables the user to stay anonymous but still save values in other softgis apps. GET request returns the session POST request creates a session for anonymous user DELETE request ends the session """ if request.method == "GET": return HttpResponse(request.session.session_key) elif request.method == "POST": if request.user.is_authenticated(): return HttpResponse(u"session already created") create_anonymous_user(request) return HttpResponse(u"session created") elif request.method == "DELETE": django_logout(request) return HttpResponse(u"session end")
def logout_page(request): # check whether the true parameter exists user_logout_parameter = request.GET.get("logout") if user_logout_parameter: django_logout(request) # logout the user! Destroying the session return HttpResponseRedirect("/") return HttpResponseRedirect("/")
def logout(request): logger.debug(request) django_logout(request) if request.POST.get('cas', False): return cas_logoutRedirect() RequestContext(request) return HttpResponseRedirect(settings.REDIRECT_URL+'/login')
def logout(request): """ logout est la views qui permet de se deconnecter """ django_logout(request) return redirect("/")
def form_valid(self, form): user = form.cleaned_data.get('user') UserSite.objects.filter(user=user).delete() user.is_active = False user.save() django_logout(self.request) return redirect('account_delete_complete')
def logout(request): partner_pk = request.session[settings.PARTNER_SESSION_KEY] \ if settings.PARTNER_SESSION_KEY in request.session \ else None django_logout(request) if partner_pk: request.session[settings.PARTNER_SESSION_KEY] = partner_pk
def delete_account(request): user = request.user user.is_active = False user.email = None user.save() django_logout(request) return redirect('/confirm')
def logout(request): session_id = request.session.get('sessionid') if session_id: UOWSClient().logout(session_id) django_logout(request) request.session.flush() return redirect('index')
def logout(self, request = None): """ User requested logout. This cleans up browser-specific information, including - user object - SMS authentication codes - Authentication state - If request object was provided, Django user object. """ if request: custom_log(request, "Logging out") else: log.info("Logging out: bid=%s" % self.bid) self.revoke_sms() if self.user: # Remove cached value r.delete("num_sessions-%s" % self.user.username) self.user = None self.save_browser = False self.auth_level = Browser.L_UNAUTH self.auth_state = Browser.S_REQUEST_BASIC self.auth_level_valid_until = None self.auth_state_valid_until = None self.authenticator_qr_nonce = None if request is not None: django_logout(request) self.save() self.auth_state_changed()
def logout(request): django_logout(request) response = HttpResponseRedirect('/footprint/login') response.set_cookie(key=settings.SPROUTCORE_COOKIE_KEY, expires=datetime.utcnow()) messages.add_message(request, messages.SUCCESS, "Successfully logged out.") return response
def logout(request): """ Log out view """ django_logout(request) messages.success(request,'Has cerrado sesión') return redirect('/')
def logout(request): """ Log out view """ django_logout(request) request.session["popup"] = 0 return redirect('/accounts/login')
def logout(request): redirect_url = request.META.get('HTTP_REFERER') if not redirect_url or reverse('login') in redirect_url: redirect_url = '/' django_logout(request) cache.clear() return redirect(redirect_url)
def logout(request): """ Log out from the page """ from django.contrib.auth import logout as django_logout django_logout(request) return index(request)
def logout(request): data = {} django_logout(request) messages.success(request, _(u"Benutzer ausgeloggt!")) return redirect(main)
def login(request): if request.user.is_authenticated(): return redirect('main.views.index') if request.POST: # load up the form with data from the POST request form = LoginForm(request.POST) if form.is_valid(): user = authenticate(username=form.cleaned_data['email'], password=form.cleaned_data['password']) if user is not None: django_login(request, user) fingr_user = user_to_fingr(request.user) notify_all_friends(fingr_user, 'Your friend ' + str(fingr_user.username) + ' has signed in') if user_to_fingr(user).verified: notify_all_friends(fingr_user, 'Your friend ' + str(fingr_user.username) + ' has signed in') # redirect to main page return redirect('main.views.index') else: django_logout(request) #redirect to index page return redirect('main.views.index') else: form = LoginForm() return render(request, 'login.html', {'form': form})
def logout(request): if request.user.is_authenticated(): django_logout(request) messages.success(request,'Tchau!') return render_to_response('login.html', locals(), context_instance=RequestContext(request)) else: return render_to_response('index.html', locals(), context_instance=RequestContext(request))
def logout(request): """ A simple request to check what the users auth status. Used to updated the user_block. """ django_logout(request) return handle_auth_block(request)
def logout(request): """ Logout and redirect to login view """ django_logout(request) messages.success(request, _('Logout successful!')) return render(request, 'auth/login.html')
def logout(request): if request.user.is_authenticated(): if request.method == "POST": django_logout(request) return redirect("posts_main") else: return render(request, "users/logout.html")
def logout(request): """ Logs out the current user and clears their session data. Redirects to /. Doesn't throw any errors if the user isn't logged in. """ django_logout(request) return HttpResponseRedirect('/')
def logout(request): """Log out view. :param request: A django request object. :type request: request """ django_logout(request) return HttpResponseRedirect(reverse('user_map:index'))
def logout(self, request, **kwargs): self.method_check(request, allowed=['get']) if request.user and request.user.is_authenticated(): django_logout(request) return self.create_response(request, {'success': True}) else: raise CustomBadRequest(code='invalid_request', message="You are not logged in.")
def auth_logout(request, next='/'): ''' View to handle a logout, which clears the session history as well. ''' django_logout(request) if request.session.get("organization_id",None): del request.session["organization_id"] return HttpResponseRedirect(next)
def get(self, request): """ Hace logout de un usuario y le redirige al login :param request: objeto HttpRequest :return: objeto HttpResponse de redirección al login """ django_logout(request) return redirect('login')
def logout(request): django_logout(request) print("Logging out") return redirect('/')
def logout(request): if request.user.is_authenticated(): django_logout(request) return HttpResponseRedirect("%slogout/" % settings.PGAUTH_REDIRECT)
def logout_user(request): django_logout(request) return HttpResponseRedirect('/')
def get(self, request): if request.user.is_authenticated(): django_logout(request) return redirect('photos_home')
def logout(self, request): """ 登出当前用户 """ django_logout(request) return Response({"success": True})
def logout(request): """ Log out view """ django_logout(request) return redirect('/accounts/login')
def logout(request): request.session.clear() django_logout(request) return HttpResponseRedirect(LOGIN_URL)
def logout(self, request): ''' handle user's logout when POST to /api/accounts/logout/ ''' django_logout(request) return Response(status=status.HTTP_200_OK)
def salir(request): request.session.clear() django_logout(request) return HttpResponseRedirect(LOGIN_REDIRECT_URL)
def logout(request): logger.debug("in logout") logger.debug(">>>>>>>>>>>>>>>>>>" + str(request.user)) audit(request, 'User logged out') django_logout(request) return redirect('/vital/login')
def logout(request): django_logout(request) messages.success(request, 'You are now logged out') return redirect('index')
def logout(request): if request.user.is_authenticated: django_logout(request) return redirect('login')
def logout(request): print '*** logout ***' django_logout(request) return HttpResponseRedirect('/')
def logout(request): django_logout(request) return redirect(reverse("index"))
def logout(request): django_logout(request) return HttpResponseRedirect('/menu')
def post(self, request): django_logout(request) return Response(status=204)
def get(self,request): django_logout(request) return redirect('/')
def logout(self, request): django_logout(request)
def logout(request): """ Log out view """ django_logout(request) return redirect('/home')
def logout_view(request): if request.method == 'GET': request.session.token = '' django_logout(request) return redirect('UserJourney:login_view')
def logout(request): session_key = request.session.session_key django_logout(request) return redirect('/admin/')
def logout(request): django_logout(request) return HttpResponseRedirect(request.POST.get('next', '/'))
def logout(request): django_logout(request) return render(request, "users/login.html", {"message": "You are now logged out."})
def post(self, request): django_logout(request) return Response({'message': 'logout'}, status=204)
def logout_process(request): django_logout(request) return render(request, 'out.html')
def rcauth(request): # Only POST is supported on this URL. if request.method != 'POST': raise PermissionDenied # Rapid Connect authorization is disabled, so don't # process anything. if not settings.RAPID_CONNECT_ENABLED: raise PermissionDenied try: # Verifies signature and expiry time verified_jwt = jwt.decode( request.POST['assertion'], settings.RAPID_CONNECT_CONFIG['secret'], audience=settings.RAPID_CONNECT_CONFIG['aud']) # Check for a replay attack using the jti value. jti = verified_jwt['jti'] if JTI.objects.filter(jti=jti).exists(): logger.debug('Replay attack? ' + str(jti)) request.session.pop('attributes', None) request.session.pop('jwt', None) request.session.pop('jws', None) django_logout(request) return redirect('/') else: JTI(jti=jti).save() if verified_jwt['aud'] == settings.RAPID_CONNECT_CONFIG['aud'] and \ verified_jwt['iss'] == settings.RAPID_CONNECT_CONFIG['iss']: request.session['attributes'] = verified_jwt[ 'https://aaf.edu.au/attributes'] request.session['jwt'] = verified_jwt request.session['jws'] = request.POST['assertion'] institution_email = request.session['attributes']['mail'] logger.debug('Successfully authenticated %s via Rapid Connect.' % institution_email) # Create a user account and profile automatically. In future, # support blacklists and whitelists. first_name = request.session['attributes']['givenname'] c_name = request.session['attributes'].get('cn', '').split(' ') if not first_name and len(c_name) > 1: first_name = c_name[0] user_args = { 'id': institution_email.lower(), 'email': institution_email.lower(), 'password': pwgen.pwgen(), 'first_name': first_name, 'last_name': request.session['attributes']['surname'], } # Check for an email collision. edupersontargetedid = request.session['attributes'][ 'edupersontargetedid'] for matching_user in UserProfile.objects.filter( user__email__iexact=user_args['email']): if (matching_user.rapidConnectEduPersonTargetedID is not None and matching_user.rapidConnectEduPersonTargetedID != edupersontargetedid): del request.session['attributes'] del request.session['jwt'] del request.session['jws'] django_logout(request) raise PermissionDenied user = auth_service.get_or_create_user(user_args) if user is not None: user.backend = 'django.contrib.auth.backends.ModelBackend' djauth.login(request, user) return redirect('/') else: del request.session['attributes'] del request.session['jwt'] del request.session['jws'] django_logout(request) raise PermissionDenied # Error: Not for this audience except jwt.ExpiredSignature: del request.session['attributes'] del request.session['jwt'] del request.session['jws'] django_logout(request) raise PermissionDenied # Error: Security cookie has expired
def logout(request): django_logout(request) return redirect('post:post_list')
def logout(request): django_logout(request) return redirect('login')
def logout(request): django_logout(request) return HttpResponseRedirect(reverse('home'))
def logout(self, request): django_logout(request) return Response({'success': True})