X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FPlack%2FApp%2FGruntmaster.pm;h=e0f921df77625ec0f9e9a0cc81b765fdcd876afb;hb=fd85a0df209242d83d453d9847aebfe4513100f4;hp=0cb7aabca2fa1b0dd392b33ea74b9f0b29d61900;hpb=8ee0846af473b6b58ad0641406b56b255ca26366;p=plack-app-gruntmaster.git diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 0cb7aab..e0f921d 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -279,6 +279,8 @@ website using the following information: Username: $_{username} Password: Reset token: $token + +The token is valid for 24 hours. EOF my $email = Email::Simple->create( header => [ @@ -302,6 +304,7 @@ EOF my $user = db->user($_{username}); return reply 'No such user' unless $user; my ($token, $exp) = split ':', $_{token}; + return reply 'Reset token is expired' if time >= $exp; return reply 'Bad reset token' unless $user->make_reset_hmac($exp) eq $token; $user->set_passphrase($_{password}); reply 'Password reset successfully';