diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index 119f79c3..52716b6f 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -84,6 +84,12 @@ class LoginController < ApplicationController def expire_session # this is a hack to enable cucumber to expire a session by calling this # method. The method will be unavailable for production environment + + @user.forget_me if logged_in? + cookies.delete :auth_token + session['user_id'] = nil + reset_session + unless Rails.env.production? session['expiry_time'] = Time.now respond_to do |format| diff --git a/app/views/login/check_expiry.js.erb b/app/views/login/check_expiry.js.erb index 22b7882d..d0c11df8 100644 --- a/app/views/login/check_expiry.js.erb +++ b/app/views/login/check_expiry.js.erb @@ -5,4 +5,5 @@ -%> $('div#navcontainer').hide(); $('div#content').html('<%=theHtml%>'); + refresh_page(); // refresh the page. if it fails, the message above remains <% end -%> \ No newline at end of file diff --git a/app/views/todos/check_deferred.js.erb b/app/views/todos/check_deferred.js.erb index ecd8bed6..4f2c0be2 100644 --- a/app/views/todos/check_deferred.js.erb +++ b/app/views/todos/check_deferred.js.erb @@ -1,3 +1,3 @@ <% unless @due_tickles.empty? -%> - TracksPages.page_notify('notice', "<%=t('todos.tickler_items_due', :count => @due_tickles.length)%>", 5); + TracksPages.page_notify('notice', "<%=t('todos.tickler_items_due', :count => @due_tickles.length)%>", 8); <% end -%> diff --git a/app/views/users/destroy.js.erb b/app/views/users/destroy.js.erb index 1f97f075..97f3c2b6 100644 --- a/app/views/users/destroy.js.erb +++ b/app/views/users/destroy.js.erb @@ -1,7 +1,7 @@ <% if @saved -%> remove_user_from_page(); TracksPages.set_page_badge(<%= @total_users %>); - TracksPages.page_notify('notice', '<%= t('users.destroy_successful', :login => @deleted_user.login) %>', 5); + TracksPages.page_notify('notice', '<%= t('users.destroy_successful', :login => @deleted_user.login) %>', 8); <% else -%> TracksPages.page_notify('error', '<%= t('users.destroy_error', :login => @deleted_user.login) %>', 8); <% end -%> diff --git a/features/logging_in.feature b/features/logging_in.feature index f0b4d7cd..10874105 100644 --- a/features/logging_in.feature +++ b/features/logging_in.feature @@ -56,4 +56,4 @@ Feature: Existing user logging in And I submit the login form as user "testuser" with password "secret" Then I should be on the login page When my session expires - Then I should see "Session has timed out" \ No newline at end of file + Then I should be on the login page \ No newline at end of file diff --git a/public/javascripts/application.js b/public/javascripts/application.js index e98c592c..45c13712 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -999,6 +999,10 @@ function redirect_to(path) { window.location.href = path; } +function refresh_page() { + location.reload(true); +} + function setup_auto_refresh(interval){ field_touched = false; function refresh_page() {