app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def auth
    if user_signed_in?
      redirect_to root_path
    else
      user = User.find_by_id(params[:user_id])
      if (
        user.nil? ||
        (user.sign_in_id != params[:id]) ||
        (user.sign_in_key != params[:key])
      )
        not_found
      end
      user.delete_sign_in_key!
      sign_in_and_redirect user
    end
  end
def auth if user_signed_in? redirect_to root_path else user = User . find_by_id ( params [ :user_id ] ) if ( user . nil? || ( user . sign_in_id != params [ :id ] ) || ( user . sign_in_key != params [ :key ] ) ) not_found end user . delete_sign_in_key! sign_in_and_redirect user end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .