From 6ed9d04c2938b70e215d69e71e48d15edbba0a2b Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Mon, 14 Sep 2015 09:35:24 +0100 Subject: [PATCH] Always use lower case version of student's email address. --- Kinza/lib/Kinza.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kinza/lib/Kinza.pm b/Kinza/lib/Kinza.pm index 9c62358..c71aa69 100644 --- a/Kinza/lib/Kinza.pm +++ b/Kinza/lib/Kinza.pm @@ -202,7 +202,7 @@ post '/register' => sub { session 'error', undef; - unless ($email = param('email') + unless ($email = lc param('email') and $pass1 = param('password') and $pass2 = param('password2')) { session 'error' => 'You must fill in all values'; return redirect '/register'; @@ -289,7 +289,7 @@ post '/resend' => sub { } $student->update({ - email => param('email'), + email => lc param('email'), }); # reread from database $student->discard_changes; @@ -316,7 +316,7 @@ post '/login' => sub { } my $user = $rs{Student}->find({ - email => params->{email}, + email => lc params->{email}, }); unless ($user) { session 'error' => 'Invalid email or password'; @@ -356,7 +356,7 @@ post '/password' => sub { session 'error' => 'You must give an email address'; return redirect '/password'; } - my $email = params->{email}; + my $email = lc params->{email}; my $student = $rs{Student}->find({ email => $email, });