Skip to content

Access Rodauth Feature Auth Methods #91

Answered by janko
andyrue asked this question in Q&A
Discussion options

You must be logged in to vote

You can access Rodauth instance methods through the internal request instance that you can initialize with Rodauth::Rails.rodauth. However, in many cases, these methods are relying on certain state being set. In this case, #create_reset_password_key relies on @reset_password_key_value, which is set by calling #generate_reset_password_key_value, which is a private method.

So, I'd recommend going the internal request route. When calling reset_password_request, you could disable sending the email in internal request configuration, and send the welcome email instead. Here is a self-contained example showing this:

Vanilla Rodauth example
require "roda"
require "sequel"

DB = Sequel.sqlite
DB.c…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@andyrue
Comment options

Answer selected by andyrue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants