Redirect loop when user is signed in - RESOLVED


#1

Hi!
I'm trying to do challenge 45.1 in Newstand 1 but I can't get it to work properly. I have tried to modify require_user with an if statement to check if current user is on login_path or signup_path and then redirect to root_path. It generates some kind of redirect loop. I need some help to figure out how to make it work and what I'm doing wrong.

 def require_user
    if current_user
      if login_path or signup_path
        redirect_to root_path
      end
    else
    	redirect_to login_path
    end
  end

#2

This should probably be thrown in the general direction of an advisor


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.