coalescing_panda 1.1.14 → 1.1.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8a422b715b98714447ffa0b276cd914031e5111
4
- data.tar.gz: fb0e1283ac89c149e9c28dc820d4203eed172768
3
+ metadata.gz: 586a3f3cd77822569ab70d6df79eb8fe9fafa0d0
4
+ data.tar.gz: 12c1e9effb2464a6c07c2da7f79b66a09cbc60fa
5
5
  SHA512:
6
- metadata.gz: 44c09e932d42391bfc2671d9a0a47e1e1300a08131045d4e45ed101610e801954e6472feafff76bbe59a2e741b6b98285a9a1b165361456be16bcceaa9cb7bd9
7
- data.tar.gz: 60042364f41a52e3e979c799334dec2f34d4d76654c9bd31c18c0d41038a8159eaccafcd342a29c6cfee094034e825539548b4fae5263f6c2492d0da2aadb666
6
+ metadata.gz: 60539ca62e3c2ad213a89aada9b6525befd0ea902dfad26e896591feee3ea359eec4ea2d2ef789c3bd2d0c2f478a69a43e072919134c1a29d5be2d34c88f90bf
7
+ data.tar.gz: 1c06319f1a65a1e54628870d37c6a7c04cc08bd6f4e83cb81ae2e1d88d2f0238f48f997bbffd1e453b7070267f7d8fb787ebe9b879dcfc8d82ccfdda035eb80f
@@ -1,22 +1,5 @@
1
1
  module CoalescingPanda
2
2
  class ApplicationController < ActionController::Base
3
- require 'useragent'
4
-
5
- before_filter :session_check
6
-
7
- def session_check
8
- user_agent = UserAgent.parse(request.user_agent) # Uses useragent gem!
9
- if user_agent.browser == 'Safari' # we apply the fix..
10
- return if session[:safari_cookie_fixed] # it is already fixed.. continue
11
- if params[:safari_cookie_fix].present? # we should be top window and able to set cookies.. so fix the issue :)
12
- session[:safari_cookie_fixed] = true
13
- redirect_to params[:return_to]
14
- else
15
- # Redirect the top frame to your server..
16
- query = params.to_query
17
- render :text => "<script>var referrer = document.referrer; top.window.location='?safari_cookie_fix=true&return_to='.concat(encodeURI(referrer));</script>"
18
- end
19
- end
20
- end
3
+
21
4
  end
22
5
  end
@@ -1,5 +1,6 @@
1
1
  module CoalescingPanda
2
2
  module ControllerHelpers
3
+ require 'useragent'
3
4
 
4
5
  def canvas_oauth2(*roles)
5
6
  return if have_session?
@@ -112,5 +113,20 @@ module CoalescingPanda
112
113
  end
113
114
  end
114
115
 
116
+ def session_check
117
+ user_agent = UserAgent.parse(request.user_agent) # Uses useragent gem!
118
+ if user_agent.browser == 'Safari' # we apply the fix..
119
+ return if session[:safari_cookie_fixed] # it is already fixed.. continue
120
+ if params[:safari_cookie_fix].present? # we should be top window and able to set cookies.. so fix the issue :)
121
+ session[:safari_cookie_fixed] = true
122
+ redirect_to params[:return_to]
123
+ else
124
+ # Redirect the top frame to your server..
125
+ query = params.to_query
126
+ render :text => "<script>var referrer = document.referrer; top.window.location='?safari_cookie_fix=true&return_to='.concat(encodeURI(referrer));</script>"
127
+ end
128
+ end
129
+ end
130
+
115
131
  end
116
132
  end
@@ -1,3 +1,3 @@
1
1
  module CoalescingPanda
2
- VERSION = '1.1.14'
2
+ VERSION = '1.1.15'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coalescing_panda
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.14
4
+ version: 1.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Mills
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-11 00:00:00.000000000 Z
11
+ date: 2014-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails