I am using Devise for authentication in my application.
How do I forbid certain users from signing in – kind of disable a user?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do it like this:
Create a column called
is_activefor theUsermodel.Then add the code below to the
Usermodel:UPDATE
As Matt Huggins notes, the method is now called
active_for_authentication?(Documentation)