From 2f7d3ce4b698a1fea4c268bf275fa30a5a845deb Mon Sep 17 00:00:00 2001 From: vikin91 Date: Wed, 1 May 2019 08:41:29 +0200 Subject: [PATCH] Fix: Store hashed password after password reset. Fixes #40 --- lib/BibSpace/Controller/Login.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/BibSpace/Controller/Login.pm b/lib/BibSpace/Controller/Login.pm index 6cc19d7..8c71339 100644 --- a/lib/BibSpace/Controller/Login.pm +++ b/lib/BibSpace/Controller/Login.pm @@ -103,7 +103,7 @@ sub promote_to_rank { my $rank = shift; my $profile_id = $self->param('id'); - my $user_obj = $self->app->repo->users_find(sub { $_->id == $profile_id }); + my $user_obj = $self->app->repo->users_find(sub { $_->id == $profile_id }); my $me = $self->app->repo->users_find(sub { $_->login eq $self->session('user') }); @@ -324,9 +324,9 @@ sub store_password { if ($pass1 eq $pass2 and check_password_policy($pass1)) { - my $salt = salt(); - my $hash = encrypt_password($pass1, $salt); - $user->pass($pass1); + my $salt = salt(); + my $password_hash = encrypt_password($pass1, $salt); + $user->pass($password_hash); $user->pass2($salt); $user->forgot_token(""); $self->flash(