summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-09 08:40:46 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-09 08:40:46 +0100
commit0f51f406618eba4f04799fc0a4e6ad7660fe5e27 (patch)
treeeb6f31d035305e5aca33113d58b8faa2b7d93a05
parent844a95f77f7bfca74264ae6dc062094bc8622f6a (diff)
show separate errors for 'invalid credentials' and 'not confirmed yet'
-rwxr-xr-xindex.pl8
-rw-r--r--templates/login.html.ep8
2 files changed, 13 insertions, 3 deletions
diff --git a/index.pl b/index.pl
index dfc3358..d0e29c6 100755
--- a/index.pl
+++ b/index.pl
@@ -923,7 +923,13 @@ post '/login' => sub {
$self->redirect_to('/');
}
else {
- $self->render( 'login', invalid => 'credentials' );
+ my $data = $self->get_user_password($user);
+ if ( $data and $data->{status} == 0 ) {
+ $self->render( 'login', invalid => 'confirmation' );
+ }
+ else {
+ $self->render( 'login', invalid => 'credentials' );
+ }
}
}
};
diff --git a/templates/login.html.ep b/templates/login.html.ep
index cf4364f..fc8bbb8 100644
--- a/templates/login.html.ep
+++ b/templates/login.html.ep
@@ -34,11 +34,15 @@
% }
% elsif ($invalid eq 'credentials') {
<span class="card-title">Ungültige Logindaten</span>
- <p>Falscher (oder noch nicht freigeschalteter) Account oder falsches Passwort.</p>
+ <p>Falscher Account oder falsches Passwort.</p>
+ % }
+ % elsif ($invalid eq 'confirmation') {
+ <span class="card-title">Account nicht freigeschaltet</span>
+ <p>Bitte besuche zuerst den per Mail verschickten Bestätigungslink.</p>
% }
% else {
<span class="card-title">Unbekannter Fehler</span>
- <p>Das sollte nicht passieren™</p>
+ <p>„<%= $invalid %>“</p>
% }
</div>
</div>