I would like to change the user sign-in behaviour of devise in a way to redirect a user to a different page when that user is not confirmed.
I have the following code in my app/controllers/sessions_controller.rb:
# POST /user/sign_in
def create
@user = warden.authenticate!(:scope => :user)
sign_in @user
respond_with @user, :location => after_sign_in_path_for(@user)
end
When the user has put correct username/password and is not confirmed Warden will raise an error that will redirect the user to the sign in page (code 302). At the same time this will put flash[:alert] to "unconfirmed".
Is there a way to redirect an unconfirmed user to a specific page?
My idea to work around this was reading the flash[:alert] value and redirecting to the appropriate page if the value is "unconfirmed" but warden is not sending additional data about the user.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)