Answer the question
In order to leave comments, you need to log in
How to override Devise authentication in Rails?
The fact is that the user is not deleted after deletion, and the visible field takes on the value of zero. I do not know how to check for an additional parameter. Tried like this:
class Users::SessionsController < Devise::SessionsController
layout "devise"
# POST /resource/sign_in
def create
@user = User.find_by_email(params[:user][:email])
if @user.visible == 0
flash[:notice] = "#{ @user.email } do not have portal access."
redirect_to :controller => 'welcome'
else
super
end
end
Answer the question
In order to leave comments, you need to log in
And in routes.rb they indicated which controller to use for sessions?
It's done something like this:
devise_for :users, controllers: {sessions: 'users/sessions'}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question