lib/rodauth/features/verify_account.rb in rodauth-2.31.0 vs lib/rodauth/features/verify_account.rb in rodauth-2.32.0

- old
+ new

@@ -22,10 +22,12 @@ before before 'verify_account_email_resend' button 'Verify Account' button 'Send Verification Email Again', 'verify_account_resend' redirect + response + response :verify_account_email_sent redirect(:verify_account_email_sent){default_post_email_redirect} redirect(:verify_account_email_recently_sent){default_post_email_redirect} email :verify_account, 'Verify Account' auth_value_method :verify_account_key_param, 'key' @@ -67,32 +69,26 @@ r.get do resend_verify_account_view end r.post do - verified = false if account_from_login(param(login_param)) && allow_resending_verify_account_email? if verify_account_email_recently_sent? set_redirect_error_flash verify_account_email_recently_sent_error_flash redirect verify_account_email_recently_sent_redirect end before_verify_account_email_resend if verify_account_email_resend after_verify_account_email_resend - verified = true + verify_account_email_sent_response end end - if verified - set_notice_flash verify_account_email_sent_notice_flash - else - set_redirect_error_status(no_matching_login_error_status) - set_error_reason :no_matching_login - set_redirect_error_flash verify_account_resend_error_flash - end - + set_redirect_error_status(no_matching_login_error_status) + set_error_reason :no_matching_login + set_redirect_error_flash verify_account_resend_error_flash redirect verify_account_email_sent_redirect end end route do |r| @@ -152,11 +148,10 @@ if verify_account_autologin? autologin_session('verify_account') end remove_session_value(verify_account_session_key) - set_notice_flash verify_account_notice_flash - redirect verify_account_redirect + verify_account_response end set_error_flash verify_account_error_flash verify_account_view end