Replies: 3 comments 5 replies
-
Commented in #347 (comment), but let's continue the discussion here. |
Beta Was this translation helpful? Give feedback.
-
You could pass custom params to the internal request method: before_create_account do
if internal_request?
account[:foo] = param("foo")
# ...
end
end RodauthApp.rodauth.create_account(..., params: { "foo" => "bar" }) Or you could have the block passed to before_create_account do
# ...
instance_eval(&internal_request_block) if internal_request?
end RodauthApp.rodauth.create_account(...) do
account[:foo] = "bar"
# ...
end
The JWT Refresh feature page documents refreshing. Not sure what you mean by setting them, they are automatically set on any JSON request.
I think your best bet is using the |
Beta Was this translation helpful? Give feedback.
-
Also, @janko , do you have any experience using Rodauth Rails in a Sorbet typed ruby project. Despite generating the rbis, the methods seem not be recognized, and I can't find most of them in the rbi files either. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've had a really tough time setting up rodauth rails to work in an existent Rails 8 app. We already have an existent users table and have set up rodauth to continue with this table. It has an email field and a password digest field from bcrypt.
We also have an existent route that takes care of user creation within a transaction along with other entities. We would like to generate a verification key after user creation and then send an email to the user after to verify their account. We haven't found any documentation to point us at how to do this within a job after user creation, as we're not accessing rodauth from a controller.
We can call
RodauthApp.rodauth.verify_account(account_login: "email@example.com")
, but we can't find docs that point us to the specific methods we need to both generate the key and send the email.RodauthApp.rodauth.methods
generates a couple but we can't go through them all one after the other till we find the appropriate one.Secondly when we try to create a user via the /create_account endpoint, we get the error - passwords do not match despite us providing the email and password in the request.
When we try to login a user, we get the success message that the user has been logged in but with no token provided, even though the documentation says with
jwt
enabled, the token will be sent back. We did set the secret in the main.rb file asjwt_secret ENV.fetch('RODAUTH_JWT_SECRET') { Rails.application.secret_key_base }
How can we figure out the methods available to rodauth in order access it within a job and send the emails as well as generate the verification keys? How can we get a token back from the login request?
These are just the basics for authentication we're trying to set up and we haven't even begun the advanced stuff. We would appreciate it if anyone points us to accurate docs to help implement rodauth or point out what we're missing.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions