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 $aClient = $_[0];
|
||||||
my $aLocation = $_[1];
|
my $aLocation = $_[1];
|
||||||
|
|
||||||
my $response = getBaseResponse(301, "Moved Permanently");
|
my $response = getBaseResponse(307, "Temporary Redirect");
|
||||||
$response.="Content-Length: 0\r\n";
|
$response.="Content-Length: 0\r\n";
|
||||||
$response.="Location: $aLocation\r\n";
|
$response.="Location: $aLocation\r\n";
|
||||||
$aClient->send($response);
|
$aClient->send($response);
|
||||||
|
@ -256,8 +256,7 @@ sub handlePath {
|
|||||||
$query->execute($session->{"username"});
|
$query->execute($session->{"username"});
|
||||||
my @row = $query->fetchrow_array();
|
my @row = $query->fetchrow_array();
|
||||||
my $password = $row[0];
|
my $password = $row[0];
|
||||||
my $hashedPassword = Digest::SHA::sha256_hex($password);
|
if($password ne Digest::SHA::sha256_hex($parameters{"currentPassword"})) {
|
||||||
if($hashedPassword ne $password) {
|
|
||||||
frontend::sendBadRequest($aClient, "Wrong password");
|
frontend::sendBadRequest($aClient, "Wrong password");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user