show separate errors for 'invalid credentials' and 'not confirmed yet'
This commit is contained in:
parent
844a95f77f
commit
0f51f40661
2 changed files with 13 additions and 3 deletions
6
index.pl
6
index.pl
|
@ -922,10 +922,16 @@ post '/login' => sub {
|
||||||
if ( $self->authenticate( $user, $password ) ) {
|
if ( $self->authenticate( $user, $password ) ) {
|
||||||
$self->redirect_to('/');
|
$self->redirect_to('/');
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
my $data = $self->get_user_password($user);
|
||||||
|
if ( $data and $data->{status} == 0 ) {
|
||||||
|
$self->render( 'login', invalid => 'confirmation' );
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$self->render( 'login', invalid => 'credentials' );
|
$self->render( 'login', invalid => 'credentials' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
get '/register' => sub {
|
get '/register' => sub {
|
||||||
|
|
|
@ -34,11 +34,15 @@
|
||||||
% }
|
% }
|
||||||
% elsif ($invalid eq 'credentials') {
|
% elsif ($invalid eq 'credentials') {
|
||||||
<span class="card-title">Ungültige Logindaten</span>
|
<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 {
|
% else {
|
||||||
<span class="card-title">Unbekannter Fehler</span>
|
<span class="card-title">Unbekannter Fehler</span>
|
||||||
<p>Das sollte nicht passieren™</p>
|
<p>„<%= $invalid %>“</p>
|
||||||
% }
|
% }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue