X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FPlack%2FApp%2FGruntmaster.pm;h=2edc6dc2999daa3cbb9006cb3954e25b48fe4ada;hb=1e40e2d97db975268d551634df3586a477eb3e6e;hp=bfc2e27049b064f09bc4d7f6e1c4d4fb5b01c8bc;hpb=3c434a02d3cc1438e4944c2a143e4989ab0c74a6;p=plack-app-gruntmaster.git diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index bfc2e27..2edc6dc 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -278,6 +278,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 => [ @@ -301,6 +303,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';