From: Marius Gavrilescu Date: Mon, 16 Feb 2015 15:20:57 +0000 (+0200) Subject: Make the make_reset_hmac function actually useful X-Git-Tag: 5999.000_014~68 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;ds=sidebyside;h=47fdf989971c179b1e74ad3b354197c3eee44d20;p=gruntmaster-data.git Make the make_reset_hmac function actually useful --- diff --git a/lib/Gruntmaster/Data/Result/User.pm b/lib/Gruntmaster/Data/Result/User.pm index 35c6675..5c8fe85 100644 --- a/lib/Gruntmaster/Data/Result/User.pm +++ b/lib/Gruntmaster/Data/Result/User.pm @@ -269,7 +269,8 @@ sub make_reset_hmac { my ($self, $expire) = @_; $expire //= time + 60 * 60; $hmackey //= random_bytes 512; - hmac_sha1_base64 $self->id . " $expire " . $self->passphrase, $hmackey; + my $hmac = hmac_sha1_base64 $self->id . " $expire " . $self->passphrase, $hmackey; + wantarray ? ($hmac, $expire) : $hmac } 1;