def bounce_user(redirect_url = request.url)
    # NOTE: this is tested in CookieControllerTest
    respond_to do |format|
      format.html do
        @redirect_url = redirect_url
        if current_user
          render 'session/forbidden', layout: false, status: :forbidden
        else
          flash[:auth_redirect_url] = redirect_url
          render 'session/forbidden', layout: false, status: :forbidden
        end
      end
      format.json do
        message = current_user ? "You're not allowed to access that" :
                                 'Please sign in'
        render json: { error: message }
      end
    end
  end
def bounce_user(redirect_url = request.url)
    # NOTE: this is tested in CookieControllerTest
    respond_to do |format|
      format.html do
        @redirect_url = redirect_url
        if current_user
          render 'session/forbidden', layout: false, status: :forbidden
        else
          flash[:auth_redirect_url] = redirect_url
          render 'session/forbidden', layout: false, status: :forbidden
        end
      end
      format.json do
        message = current_user ? "You're not allowed to access that" :
                                 'Please sign in'
        render json: { error: message }
      end
    end
  end
Inform the user that their request is forbidden.

 If a user is logged on, this renders the session/forbidden view with a HTTP
 403 code.

 If no user is logged in, the user is redirected to session/new, and the
 current request's URL is saved in flash[:auth_redirect_url].