I have a RoR application using Devise to login. There is some code that executes when creating a new user record, placing it in the user.rb file as a call to after_create / macro / whatever. I need this code to run after each login, and not run when a new user is created.
With some Googling, it seems like one option is to place the Warden callbacks in the devise.rb code. My questions:
- Is this correct and / or is there a better way to do this?
- If this is the right approach ...
- Should the Warden :: Manager ... defs method go to devise.rb inside or after Devise.setup?
- Is after_authentication a callback I should use? I just check if the directory exists based on the username, and if not, create it.
ruby-on-rails devise warden
whognu
source share