I’m using DBIx::Class::PassphraseColumn to hash passwords with Authen::Passphrase::BlowfishCrypt, which works well. However, I’m trying to use the same on a couple of other columns (password reset key / activation key), which should both be nulled after the user has activated / the password has been reset, I’m hitting an error.
The columns are set here:
__PACKAGE__->add_columns(
"password" => {
data_type => "text",
is_nullable => 0,
passphrase => "rfc2307",
passphrase_class => "BlowfishCrypt",
passphrase_args => {
cost => 14,
salt_random => 1,
},
passphrase_check_method => "check_password",
},
"activation_key" => {
data_type => "text",
is_nullable => 1,
passphrase => "rfc2307",
passphrase_class => "BlowfishCrypt",
passphrase_args => {
cost => 14,
salt_random => 1,
},
passphrase_check_method => "check_act_key",
},
"password_reset_key" => {
data_type => "text",
is_nullable => 1,
passphrase => "rfc2307",
passphrase_class => "BlowfishCrypt",
passphrase_args => {
cost => 14,
salt_random => 1,
},
passphrase_check_method => "check_password_reset_key",
}
);
The error is:
[error] Caught exception in TopTable::Controller::Users->activate “hash not specified at D:/Personal/Dev/Perl/perl/site/lib/DBIx/Class/PassphraseColumn.pm line 173.”
The update code is here:
$self->update({
activated => 1,
activation_key => undef,
activation_expires => undef,
});
If I set the activation key to an empty string, this works but leaves a hashed value – I can live with that for now, but really I’d like to be able to NULL the column if that’s possible.
Am I being totally stupid?
Thanks!