Files
nixpkgs/pkgs/by-name/la/lanraragi/expose-password-hashing.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

37 lines
1.0 KiB
Diff

diff --git a/lib/LANraragi/Controller/Config.pm b/lib/LANraragi/Controller/Config.pm
index 2cd2c999..0bd8ab6e 100644
--- a/lib/LANraragi/Controller/Config.pm
+++ b/lib/LANraragi/Controller/Config.pm
@@ -50,6 +50,15 @@ sub index {
);
}
+sub make_password_hash {
+ my $ppr = Authen::Passphrase::BlowfishCrypt->new(
+ cost => 8,
+ salt_random => 1,
+ passphrase => shift,
+ );
+ return $ppr->as_rfc2307;
+}
+
# Save the given parameters to the Redis config
sub save_config {
@@ -95,14 +104,7 @@ sub save_config {
my $password = $self->req->param('newpassword');
if ( $password ne "" ) {
- my $ppr = Authen::Passphrase::BlowfishCrypt->new(
- cost => 8,
- salt_random => 1,
- passphrase => $password,
- );
-
- my $pass_hashed = $ppr->as_rfc2307;
- $confhash{password} = $pass_hashed;
+ $confhash{password} = make_password_hash($password);
}
}