diff options
Diffstat (limited to 'src/actions/password_reset_requests/create.cr')
-rw-r--r-- | src/actions/password_reset_requests/create.cr | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/actions/password_reset_requests/create.cr b/src/actions/password_reset_requests/create.cr new file mode 100644 index 0000000..8f3c513 --- /dev/null +++ b/src/actions/password_reset_requests/create.cr @@ -0,0 +1,15 @@ +class PasswordResetRequests::Create < BrowserAction + include Auth::RedirectSignedInUsers + + post "/password_reset_requests" do + RequestPasswordReset.run(params) do |operation, user| + if user + PasswordResetRequestEmail.new(user).deliver + flash.success = "You should receive an email on how to reset your password shortly" + redirect SignIns::New + else + html NewPage, operation: operation + end + end + end +end |