From 4ad1a1d20e52f7aa4b1ae2b7cc84c83c584d6725 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 30 Apr 2019 10:46:46 +0200 Subject: Move invalid input errors into common sub-template --- lib/Travelynx/Controller/Account.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/Travelynx') diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index 5f06f2d..259fb9e 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -190,7 +190,7 @@ sub delete { ) ) { - $self->render( 'account', invalid => 'password' ); + $self->render( 'account', invalid => 'deletion password' ); return; } $self->flag_user_deletion( $self->current_user->{id} ); @@ -293,7 +293,8 @@ sub request_password_reset { my $uid = $self->get_uid_by_name_and_mail( $name, $email ); if ( not $uid ) { - $self->render( 'recover_password', invalid => 'credentials' ); + $self->render( 'recover_password', + invalid => 'recovery credentials' ); return; } @@ -360,7 +361,7 @@ sub request_password_reset { return; } if ( not $self->verify_password_token( $id, $token ) ) { - $self->render( 'recover_password', invalid => 'token' ); + $self->render( 'recover_password', invalid => 'recovery token' ); return; } if ( $password ne $password2 ) { @@ -428,7 +429,7 @@ sub recover_password { $self->render('set_password'); } else { - $self->render( 'recover_password', invalid => 'token' ); + $self->render( 'recover_password', invalid => 'recovery token' ); } } -- cgit v1.2.3