Where should warden callbacks be placed in a rails app?

前端 未结 1 1960
慢半拍i
慢半拍i 2021-02-18 15:41

I\'m relatively new to rails. I have Devise set up, and want to run some callback code after users sign in.

Looking at the Warden wiki page, I can use the \"after_set_us

相关标签:
1条回答
  • 2021-02-18 16:26

    Warden hooks need to be required when your application is booting, so inside Devise's initializer at config/initializers/devise.rb is a good candidate.

    However, the behavior you want to achieve will be better accomplished by using this Devise feature:

    https://github.com/plataformatec/devise/wiki/How-To:-Customize-user-account-status-validation-when-logging-in

    0 讨论(0)
提交回复
热议问题