Skip to content

Commit

Permalink
Always use lower case version of student's email address.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Cross committed Sep 14, 2015
1 parent 99a6dd5 commit 6ed9d04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Kinza/lib/Kinza.pm
Expand Up @@ -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';
Expand Down Expand Up @@ -289,7 +289,7 @@ post '/resend' => sub {
}

$student->update({
email => param('email'),
email => lc param('email'),
});
# reread from database
$student->discard_changes;
Expand All @@ -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';
Expand Down Expand Up @@ -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,
});
Expand Down

0 comments on commit 6ed9d04

Please sign in to comment.