2 if( CheckVersion( $DBversion ) ) {
4 use Koha::AuthUtils qw(hash_password);
6 my $sth = $dbh->prepare(q{
7 SELECT client_id, secret
11 my $results = $sth->fetchall_arrayref({});
13 $sth = $dbh->prepare(q{
21 foreach my $api_key (@$results) {
22 unless ( $api_key->{secret} =~ m/^\$2a\$08\$/ ) {
23 my $digest = Koha::AuthUtils::hash_password( $api_key->{secret} );
24 $sth->execute( $digest, $api_key->{client_id} );
28 NewVersion( $DBversion, 28772, "Store hashed API key secrets" );