lobby_boy 0.1.2 → 0.1.3

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
- SHA1:
3
- metadata.gz: 4617831685bdd22323a6cc6d1250857f50d15a73
4
- data.tar.gz: 1e891188c9ca998ee0bc2277612918f494a9ee2a
2
+ SHA256:
3
+ metadata.gz: f49e5698128828e2cca2f7f63ecf37be40e43abd555a987caa60a7e728df7d2e
4
+ data.tar.gz: 533baba3a846d3ac37a172d0b83d0b7a7623235000449ccfb0bbfa16b0267981
5
5
  SHA512:
6
- metadata.gz: ca5dbc1eb3f194a43f78e4f5c1065956d17afe8e6ec9c574337b7b5323bcd739739f3cc3e7f59526e9b0619520a0c801b3c44bd926275490f89b9dfa9ae2cbdb
7
- data.tar.gz: 89c2c6dee8629814800377d27cebfd27fedb7e913130d53810470dfaeec8a7b1bda70d8cf018bab1b85a49e1178c43e39febbf44fc2050dbac6cfee2d44ccb86
6
+ metadata.gz: 1cc1b772ed716842050b6ea3bc7f40d21a22b6182311df5f780423b531691dee10d6e21fecb113469f9d615232dc0937cb5f6a8335a694bbbaa0a23e12c3201d
7
+ data.tar.gz: 9113db7479a8cd9e1cb054fd917d276226f923eb050cb25af78c8b5aa34057565e121432c5e2c803ea6d9f9dbbe0addebeafa6dd406dfd862b592fdac21b25d2
@@ -2,7 +2,7 @@ module LobbyBoy
2
2
  class SessionController < ActionController::Base
3
3
  layout false
4
4
 
5
- before_filter :set_cache_buster
5
+ before_action :set_cache_buster
6
6
 
7
7
  def check
8
8
  response.headers['X-Frame-Options'] = 'SAMEORIGIN'
@@ -23,6 +23,10 @@
23
23
  }
24
24
 
25
25
  this.checkSession = function() {
26
+ if (document.hidden === true) {
27
+ return; // don't check session if window/tab is inactive
28
+ }
29
+
26
30
  var provider = self.getIFrame("openid_connect_provider");
27
31
 
28
32
  var message = function(state) {
@@ -82,7 +86,8 @@
82
86
  };
83
87
 
84
88
  this.stopTimer = function() {
85
- clearInterval(self.timerID)
89
+ clearInterval(self.timerID);
90
+ self.timerID = undefined;
86
91
  };
87
92
 
88
93
  this.reauthenticate = function() {
@@ -119,7 +124,7 @@
119
124
  <% if LobbyBoy.client.on_login_js_partial %>
120
125
  <%= render partial: LobbyBoy.client.on_login_js_partial, formats: [:js] %>
121
126
  <% else %>
122
- window.parent.document.location.reload();
127
+ console.log("User has logged in at OP.");
123
128
  <% end %>
124
129
  };
125
130
 
@@ -165,6 +170,12 @@
165
170
  document.addEventListener("DOMContentLoaded", function(event) {
166
171
  setTimeout(self.checkSession, 1000);
167
172
  });
173
+
174
+ window.addEventListener('load', function () {
175
+ window.addEventListener('focus', self.checkSession);
176
+ window.addEventListener('focus', self.startTimer);
177
+ window.addEventListener('blur', self.stopTimer);
178
+ });
168
179
  <% end %>
169
180
 
170
181
  self.startTimer();
@@ -7,14 +7,18 @@ module SessionManagement
7
7
  # Always append 'prompt=none' to every authorization request to make the login
8
8
  # automatic if possible.
9
9
  def authorize_uri
10
- LobbyBoy::Util::URI.add_query_params super,
11
- prompt: request.params['prompt'] || 'none',
12
- id_token_hint: request.params['id_token_hint']
10
+ return super unless LobbyBoy.configured?
11
+
12
+ LobbyBoy::Util::URI.add_query_params(
13
+ super,
14
+ prompt: request.params['prompt'] || options.prompt || 'none',
15
+ id_token_hint: request.params['id_token_hint']
16
+ )
13
17
  end
14
18
 
15
19
  def access_token
16
20
  return super unless LobbyBoy.configured?
17
-
21
+
18
22
  at = super
19
23
 
20
24
  @id_token ||= begin
@@ -13,7 +13,9 @@ module LobbyBoy
13
13
 
14
14
  additional_params.each do |name, value|
15
15
  if value
16
- params << [name, value]
16
+ params.delete_if { |param_name, _| param_name == name.to_s } # override existing
17
+
18
+ params << [name.to_s, value]
17
19
  end
18
20
  end
19
21
 
@@ -1,3 +1,3 @@
1
1
  module LobbyBoy
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lobby_boy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Finn GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-02 00:00:00.000000000 Z
11
+ date: 2018-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0.2'
47
+ version: 0.2.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0.2'
54
+ version: 0.2.1
55
55
  description:
56
56
  email:
57
57
  - info@finn.de
@@ -76,7 +76,6 @@ files:
76
76
  - lib/lobby_boy/patches/session_management.rb
77
77
  - lib/lobby_boy/util/uri.rb
78
78
  - lib/lobby_boy/version.rb
79
- - lib/tasks/lobby_boy_tasks.rake
80
79
  homepage: https://github.com/finnlabs/lobby_boy
81
80
  licenses:
82
81
  - GPLv3
@@ -97,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
96
  version: '0'
98
97
  requirements: []
99
98
  rubyforge_project:
100
- rubygems_version: 2.4.3
99
+ rubygems_version: 2.7.6
101
100
  signing_key:
102
101
  specification_version: 4
103
102
  summary: Rails engine for OpenIDConnect Session Management
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :lobby_boy do
3
- # # Task goes here
4
- # end