From 47fdf989971c179b1e74ad3b354197c3eee44d20 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Mon, 16 Feb 2015 17:20:57 +0200 Subject: [PATCH] Make the make_reset_hmac function actually useful --- lib/Gruntmaster/Data/Result/User.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.39.2