janko / rodauth-rails

Rails integration for Rodauth authentication framework
https://github.com/jeremyevans/rodauth
MIT License
564 stars 40 forks source link

Unable to resend verify account email #219

Closed 34code closed 11 months ago

34code commented 11 months ago

Somehow I'm unable to resend a verification email. I tried making a custom button for it in nav and also from the link under the login button Resend Verify Account Information

the logs on development and production don't seem verbose enough to be helpful but here they are:

Started POST "/verify-account-resend" for ::1 at 2023-07-31 20:46:14 -0700
20:46:14 web.1  | Processing by RodauthApp#call as HTML
20:46:14 web.1  |   Parameters: {"authenticity_token"=>"[FILTERED]", "email"=>"sambehera@gmail.com", "commit"=>"Send Verification Email Again"}
20:46:14 web.1  |   Sequel (2.8ms)  SELECT * FROM "accounts" WHERE (("email" = 'sambehera@gmail.com') AND ("status" IN (1, 2))) LIMIT 1
20:46:14 web.1  |   ↳ app/misc/rodauth_app.rb:11:in `block in <class:RodauthApp>'
20:46:14 web.1  | Redirected to /
20:46:14 web.1  | Completed 302 Found in 25ms (ActiveRecord: 11.2ms | Allocations: 1442)
20:46:14 web.1  |
20:46:14 web.1  |
20:46:14 web.1  | Started GET "/" for ::1 at 2023-07-31 20:46:14 -0700
20:46:14 web.1  | Processing by InfoPagesController#construction as HTML
34code commented 11 months ago

I've enabled the following in rodauth_main.rb:

enable :create_account, :verify_account, :verify_account_grace_period,
      :login, :logout, :remember,
      :reset_password_notify,
      :reset_password, :change_password, :change_password_notify,
      :change_login, :verify_login_change, :close_account, :argon2, :otp, :email_auth, :recovery_codes, :omniauth,
      :sms_codes
janko commented 11 months ago

Are you sure an unverified account with that email exists? The SQL logs would be consistent with that scenario, because the next thing Rodauth does is check whether the verification email was recently sent, but it skips doing that if it couldn't find the account.

Do you have flash messages displayed on your home page? Rodauth should always display an error flash when an action didn't succeed. When testing in the official demo app, I get a generic "Unable to resend verify account email" flash message when the account wasn't found. If you think this isn't the problem, could you create a minimal Rails app showing the problem?

Moving to discussions, as this doesn't look like a bug in rodauth-rails nor Rodauth.