[ARVADOS] updated: 9cd91512d9b615ed2f0b2c8d260e8595aee0f6b1
git at public.curoverse.com
git at public.curoverse.com
Mon Jun 23 20:34:50 EDT 2014
Summary of changes:
.../app/controllers/application_controller.rb | 6 ------
.../app/controllers/sessions_controller.rb | 1 -
.../app/controllers/user_sessions_controller.rb | 15 ++++++++++++++
apps/workbench/app/models/arvados_api_client.rb | 2 +-
.../app/views/user_sessions/logged_out.html.erb | 24 ++++++++++++++++++++++
apps/workbench/config/routes.rb | 1 +
6 files changed, 41 insertions(+), 8 deletions(-)
create mode 100644 apps/workbench/app/controllers/user_sessions_controller.rb
create mode 100644 apps/workbench/app/views/user_sessions/logged_out.html.erb
via 9cd91512d9b615ed2f0b2c8d260e8595aee0f6b1 (commit)
from 5eb91e8f604121776c7c04cb5adbf7fe32d7f8d2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 9cd91512d9b615ed2f0b2c8d260e8595aee0f6b1
Author: radhika <radhika at curoverse.com>
Date: Mon Jun 23 20:33:09 2014 -0400
2659: eliminate the need for an arv-referrer token by introducing a logout page.
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 56fe9f2..2a2cb48 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -472,12 +472,6 @@ class ApplicationController < ActionController::Base
end
def check_anonymous_token
- if session['arv-referrer'] == 'logout'
- # Do not use anonymous user token and let logout happen. But clear it for future relogins.
- session['arv-referrer'] = nil
- return
- end
-
anonymous_user_token = Rails.configuration.anonymous_user_token
if !anonymous_user_token
Thread.current[:arvados_anonymous_api_token] = nil
diff --git a/apps/workbench/app/controllers/sessions_controller.rb b/apps/workbench/app/controllers/sessions_controller.rb
index 2793e3e..97c8d5a 100644
--- a/apps/workbench/app/controllers/sessions_controller.rb
+++ b/apps/workbench/app/controllers/sessions_controller.rb
@@ -5,7 +5,6 @@ class SessionsController < ApplicationController
def destroy
session.clear
- session['arv-referrer'] = 'logout'
redirect_to arvados_api_client.arvados_logout_url(return_to: root_url)
end
diff --git a/apps/workbench/app/controllers/user_sessions_controller.rb b/apps/workbench/app/controllers/user_sessions_controller.rb
new file mode 100644
index 0000000..ec2481b
--- /dev/null
+++ b/apps/workbench/app/controllers/user_sessions_controller.rb
@@ -0,0 +1,15 @@
+class UserSessionsController < ApplicationController
+
+skip_filter :set_thread_api_token, only: [:logged_out]
+skip_filter :require_thread_api_token, only: [:logged_out]
+skip_filter :use_anonymous_token_if_necessary, only: [:logged_out]
+skip_filter :check_user_agreements, only: [:logged_out]
+skip_filter :check_user_notifications, only: [:logged_out]
+skip_filter :find_object_by_uuid, only: [:logged_out]
+
+#skip_filter _process_action_callbacks.map(&:logged_out)
+
+ def logged_out
+ end
+
+end
diff --git a/apps/workbench/app/models/arvados_api_client.rb b/apps/workbench/app/models/arvados_api_client.rb
index 25c54d1..008163a 100644
--- a/apps/workbench/app/models/arvados_api_client.rb
+++ b/apps/workbench/app/models/arvados_api_client.rb
@@ -175,7 +175,7 @@ class ArvadosApiClient
end
def arvados_logout_url(params={})
- arvados_login_url(params).sub('/login','/logout')
+ "/user_sessions/logged_out"
end
def arvados_v1_base
diff --git a/apps/workbench/app/views/user_sessions/logged_out.html.erb b/apps/workbench/app/views/user_sessions/logged_out.html.erb
new file mode 100644
index 0000000..8938c6c
--- /dev/null
+++ b/apps/workbench/app/views/user_sessions/logged_out.html.erb
@@ -0,0 +1,24 @@
+<% content_for :breadcrumbs do raw '<!-- -->' end %>
+
+<div class="row">
+ <div class="col-sm-8 col-sm-push-4" style="margin-top: 1em">
+ <div class="well clearfix">
+ <%= image_tag "dax.png", style: "width: 147px; height: 197px; max-width: 25%; margin-right: 2em", class: 'pull-left' %>
+
+ <h3>Goodbye</h3>
+
+ <p>
+ Thank you for using Arvados.
+ </p> <p>
+ Please use the "Log in" button below to log back into
+ <%= Rails.configuration.site_name %>.
+ </p>
+ <p>
+ <%= link_to arvados_api_client.arvados_login_url(return_to: root_url), class: "pull-right btn btn-primary" do %>
+ Log in to <%= Rails.configuration.site_name %>
+ <i class="fa fa-fw fa-arrow-circle-right"></i>
+ <% end %>
+ </p>
+ </div>
+ </div>
+</div>
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index a4f69b3..59fd76c 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -10,6 +10,7 @@ ArvadosWorkbench::Application.routes.draw do
get '/user_agreements/signatures' => 'user_agreements#signatures'
get "users/setup_popup" => 'users#setup_popup', :as => :setup_user_popup
get "users/setup" => 'users#setup', :as => :setup_user
+ get "user_sessions/logged_out" => 'user_sessions#logged_out'
resources :nodes
resources :humans
resources :traits
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list