From db3a4b66addfc3a563dc08c91cae610255b31e7f Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Tue, 7 Oct 2014 19:14:25 -0400 Subject: [PATCH] fixed issue that others might end up having with sso_key --- app/controllers/sessions_controller.rb | 47 -------------------------- app/helpers/sessions_helper.rb | 2 -- app/views/layouts/application.html.erb | 2 +- 3 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 app/controllers/sessions_controller.rb delete mode 100644 app/helpers/sessions_helper.rb diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb deleted file mode 100644 index 0b4eb3ad..00000000 --- a/app/controllers/sessions_controller.rb +++ /dev/null @@ -1,47 +0,0 @@ -class SessionsController < ApplicationController - - before_filter :require_no_user, only: [:new, :create] - before_filter :require_user, only: [:destroy] - - respond_to :html, :json - - def show - end - - # GET /session/new - def new - @session = Session.new - - - respond_with(@session) - end - - # POST /session - def create - @session = Session.create(params[:session]) - - @user = User.new - - @topic = Topic.exists?(260) - - if @topic - respond_with(@user, @session, location: topic_url(260)) do |format| - end - else - respond_with(@user, @session, location: root_url) do |format| - end - end - end - - # DELETE /session - def destroy - @session = Session.find - @session.destroy - - respond_to do |format| - format.html { respond_with(@session, location: restore(default: root_path)) } - end - - end - -end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb deleted file mode 100644 index 309f8b2e..00000000 --- a/app/helpers/sessions_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module SessionsHelper -end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b0e0dcca..3e56695e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -89,7 +89,7 @@ Metamaps.Loading.loader.show(); // Hidden by default // set up uservoice with signed in user - <% if authenticated? %> + <% if authenticated? && ENV['SSO_KEY'] %> USERVOICE.load(Metamaps.Active.Mapper.name, Metamaps.Active.Mapper.id, "<%= user.email %>", "<%= current_sso_token %>"); <% else %> USERVOICE.load();