From b75bb8dc0aac096eb30bf46986506e00a00fbb9a Mon Sep 17 00:00:00 2001 From: "J. Fleming" Date: Wed, 17 Jul 2013 21:00:18 +0200 Subject: [PATCH] Change devise config and templates to make logout a delete request. --- app/assets/templates/header_tpl.jst.hbs | 2 +- app/assets/templates/stream_tpl.jst.hbs | 4 ++-- app/views/shared/_footer.mobile.haml | 2 +- config/initializers/devise.rb | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/assets/templates/header_tpl.jst.hbs b/app/assets/templates/header_tpl.jst.hbs index dc713f535..9733982ed 100644 --- a/app/assets/templates/header_tpl.jst.hbs +++ b/app/assets/templates/header_tpl.jst.hbs @@ -98,7 +98,7 @@ {{#if current_user.admin}}
  • {{t "header.admin"}}
  • {{/if}} -
  • {{t "header.log_out"}}
  • +
  • {{t "header.log_out"}}
  • diff --git a/app/assets/templates/stream_tpl.jst.hbs b/app/assets/templates/stream_tpl.jst.hbs index cccb849a1..c3fb636a8 100644 --- a/app/assets/templates/stream_tpl.jst.hbs +++ b/app/assets/templates/stream_tpl.jst.hbs @@ -27,7 +27,7 @@ - + @@ -72,4 +72,4 @@ - \ No newline at end of file + diff --git a/app/views/shared/_footer.mobile.haml b/app/views/shared/_footer.mobile.haml index a35b88cdf..a6cb9e83f 100644 --- a/app/views/shared/_footer.mobile.haml +++ b/app/views/shared/_footer.mobile.haml @@ -3,4 +3,4 @@ = link_to current_user.name, current_user.person = link_to t('layouts.header.settings'), users_edit_path = link_to t('layouts.application.toggle'), toggle_mobile_path - = link_to t('layouts.header.logout'), destroy_user_session_path + = link_to t('layouts.header.logout'), destroy_user_session_path, method: :delete diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 0ce5acae5..0f238c1d1 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -159,5 +159,8 @@ Devise.setup do |config| # end # manager.default_strategies(:scope => :user).unshift :twitter_oauth # end + + # Sign out via a DELETE request + config.sign_out_via = :delete end