Avoided suggestion of plain text database password in sessions topic.

This commit is contained in:
Luke Plant 2022-01-04 05:47:24 +00:00 committed by GitHub
parent 482ee63b6f
commit ccafad2e42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -417,7 +417,7 @@ This simplistic view logs in a "member" of the site::
def login(request): def login(request):
m = Member.objects.get(username=request.POST['username']) m = Member.objects.get(username=request.POST['username'])
if m.password == request.POST['password']: if m.check_password(request.POST['password']):
request.session['member_id'] = m.id request.session['member_id'] = m.id
return HttpResponse("You're logged in.") return HttpResponse("You're logged in.")
else: else: