think_feel_do_engine 3.12.1 → 3.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e9bc166e72de3a1662a77e331abdecde3b95c7f
4
- data.tar.gz: e8301ced0a103946760cbfe164741955230735e1
3
+ metadata.gz: d8e4d81a41dca2e08ff40240e59b0d66c127831e
4
+ data.tar.gz: 9ea3ae94bbe6ed2dedd7a57cdfda73369b8d5caf
5
5
  SHA512:
6
- metadata.gz: 8a03d80170208bfd6a6d6fe4becb2b369994e50c997940d84cd7ad68bb752b56ac09128811515dc502f37d26a9c7ed15ff5f0c4227551515eee17f47383cb839
7
- data.tar.gz: df06f5a2ca7329e9084d089333b21d51f9ba98ebdab4d7b5a3c491d4b78b39cf7eebd316fc8a2a7eeef473447f683ba9c7cca44d4e31c2cc6610c7afb1657348
6
+ metadata.gz: f655994ab605059ff192c8afb13063446349629bd2a1f288f3d15c68d565825eabd6f72aa87c306398c8860c44c3004065a1c2970525f1c512a12049ac97fdee
7
+ data.tar.gz: 557b7979e7bd05a5ee513458cdb55b5815ed2871cae675c5ab28549547f5d6847c528c4a49d0a71897afd79914fe05fb8cc08cf6eb267a6b3336e3299498b5ba
@@ -4,7 +4,8 @@ module ThinkFeelDoEngine
4
4
  # Site-wide controller superclass.
5
5
  # Inherits from host's ApplicationController.
6
6
  class ApplicationController < ::ApplicationController
7
- include ThinkFeelDoEngine::Concerns::BrowserDetective
7
+ include Concerns::BrowserDetective
8
+ include Concerns::InvalidAuthToken
8
9
 
9
10
  CSRF_COOKIE_NAME = "XSRF-TOKEN"
10
11
  CSRF_HEADER_NAME = "X-XSRF-TOKEN"
@@ -0,0 +1,21 @@
1
+ module ThinkFeelDoEngine
2
+ module Concerns
3
+ # Rescues exception when authenticity token has expired
4
+ module InvalidAuthToken
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ rescue_from ActionController::InvalidAuthenticityToken,
9
+ with: :invalid_auth_token_redirect
10
+ end
11
+
12
+ private
13
+
14
+ def invalid_auth_token_redirect
15
+ redirect_to "/",
16
+ alert: "Your authenticity token expired. "\
17
+ "Please try again."
18
+ end
19
+ end
20
+ end
21
+ end
@@ -88,7 +88,7 @@
88
88
  <%= button_to "Discontinue",
89
89
  think_feel_do_engine.discontinue_membership_path(view_membership(patient, @group).id),
90
90
  data: { confirm: "Are you sure you would like to end this study? You will not be able to undo this." },
91
- method: :get,
91
+ method: :put,
92
92
  class: "btn btn-primary" %>
93
93
  </td>
94
94
  <% end %>
@@ -96,7 +96,7 @@
96
96
  <%= button_to "Terminate Access",
97
97
  think_feel_do_engine.withdraw_membership_path(view_membership(patient, @group).id),
98
98
  data: { confirm: "Are you sure you would like to terminate access to this membership? This option should also be used before changing membership of the patient to a different group or to completely revoke access to this membership. You will not be able to undo this." },
99
- method: :get,
99
+ method: :put,
100
100
  class: "btn btn-danger" %>
101
101
  </td>
102
102
  <% end %>
@@ -77,8 +77,8 @@ ThinkFeelDoEngine::Engine.routes.draw do
77
77
  end
78
78
 
79
79
  resources :memberships, only: :update do
80
- get "withdraw", on: :member
81
- get "discontinue", on: :member
80
+ put "withdraw", on: :member
81
+ put "discontinue", on: :member
82
82
  end
83
83
 
84
84
 
@@ -1,4 +1,4 @@
1
1
  # nodoc
2
2
  module ThinkFeelDoEngine
3
- VERSION = "3.12.1"
3
+ VERSION = "3.12.2"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: think_feel_do_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.12.1
4
+ version: 3.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Carty-Fickes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-11 00:00:00.000000000 Z
11
+ date: 2016-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -393,6 +393,7 @@ files:
393
393
  - app/controllers/think_feel_do_engine/coach/site_messages_controller.rb
394
394
  - app/controllers/think_feel_do_engine/coach_dashboard_controller.rb
395
395
  - app/controllers/think_feel_do_engine/concerns/browser_detective.rb
396
+ - app/controllers/think_feel_do_engine/concerns/invalid_auth_token.rb
396
397
  - app/controllers/think_feel_do_engine/concerns/navigator_enabled.rb
397
398
  - app/controllers/think_feel_do_engine/keep_alive_controller.rb
398
399
  - app/controllers/think_feel_do_engine/lesson_slides_controller.rb