Frontend: Fix user password changing and use HTTP 307 for redirecting
This commit is contained in:
parent
f36cd5085f
commit
c296f53678
@ -326,7 +326,7 @@ sub redirect {
|
||||
my $aClient = $_[0];
|
||||
my $aLocation = $_[1];
|
||||
|
||||
my $response = getBaseResponse(301, "Moved Permanently");
|
||||
my $response = getBaseResponse(307, "Temporary Redirect");
|
||||
$response.="Content-Length: 0\r\n";
|
||||
$response.="Location: $aLocation\r\n";
|
||||
$aClient->send($response);
|
||||
|
@ -256,8 +256,7 @@ sub handlePath {
|
||||
$query->execute($session->{"username"});
|
||||
my @row = $query->fetchrow_array();
|
||||
my $password = $row[0];
|
||||
my $hashedPassword = Digest::SHA::sha256_hex($password);
|
||||
if($hashedPassword ne $password) {
|
||||
if($password ne Digest::SHA::sha256_hex($parameters{"currentPassword"})) {
|
||||
frontend::sendBadRequest($aClient, "Wrong password");
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user