1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #2880: Sanitize user password if an exception is raised during login

This commit is contained in:
Jeremy Stretch
2019-02-13 11:34:16 -05:00
parent 95dea1faaa
commit cc3b26998b
2 changed files with 6 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.http import is_safe_url
from django.views.decorators.debug import sensitive_post_parameters
from django.views.generic import View
from secrets.forms import UserKeyForm
@@ -23,6 +24,10 @@ from .models import Token
class LoginView(View):
template_name = 'login.html'
@method_decorator(sensitive_post_parameters('password'))
def dispatch(self, *args, **kwargs):
return super().dispatch(*args, **kwargs)
def get(self, request):
form = LoginForm(request)