Replies: 2 comments
-
Yes, creating the account directly via the model won't trigger any Rodauth callbacks, so verification key won't be generated. The |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the explanation! I had misunderstood with rodauth-model did. Makes sense now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a signup form object which collects a bunch of info, then creates an Account. When I create the account using rodauth, everything works as expected:
RodauthApp.rodauth.create_account(login: email)
A verification email is sent, and I can see the key from the email in the account_verification_keys table. Clicking the link in the email takes me to a verification page as expected.
However, in some cases, I need to delay the sending of the verification email until the signup has been approved. So in my Signup class, I use the rodauth-model:
Account.create!(email: email)
And once the account is approved, I use the following code to send the verification email:
Rodauth::Rails.rodauth(account: account).rodauth.send_verify_account_email
The email is sent, but this time there is no new entry in the account_verification_keys table, and clicking the link in the email takes me to the login page. The rails logs show a redirect from the /verify-account to /login, but not much else.
Can anyone suggest where I'm going wrong?
Beta Was this translation helpful? Give feedback.
All reactions