[Catalyst] Userpasswords

Tobias Kremer list at funkreich.de
Thu May 22 21:32:30 BST 2008


Hi Stephan,

On 22.05.2008, at 21:48, Stephan Jennewein wrote:
> what's the common way to add user with encrypted passwords with the  
> algorithm
> i've chosen in the config . There are nice plugins for  
> authenticating users
> but no for create new users. I tried to write a hook for the schema,  
> but it
> won't work. Can anyone give me a working solution ?

I did this by overriding the store_column method like this:

sub store_column {
     my( $self, $col, $val ) = @_;
     $val = Digest::SHA::sha1_hex( $val ) if $col eq 'password_hash';
     return $self->next::method( $col, $val );
}

Hope this helps!

--Tobias





More information about the Catalyst mailing list