lobby_boy 0.1.1 → 0.1.2

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: cccadf684b2766d41e5cbded76f0dbf9ae820350
4
- data.tar.gz: 3f24e10d2ff8c69c81d82c20cdf30d27e406e1af
3
+ metadata.gz: 4617831685bdd22323a6cc6d1250857f50d15a73
4
+ data.tar.gz: 1e891188c9ca998ee0bc2277612918f494a9ee2a
5
5
  SHA512:
6
- metadata.gz: 905d98501155372ecc09c49907584aa112dd5f9a7b83b3ebf4693533f31272a3715be1fe7df534c95ab3c74742c2e11dbef277723ffd7a29d6680eb32fe1b255
7
- data.tar.gz: 6a04337e6756017209b7c789fd21a78e274dfd415b627bfe875f6081b75a9d125aa63fc2d768d1bc4f2d37fb67cda34cc57a33e14e68db08bf277d711f6ca8d9
6
+ metadata.gz: ca5dbc1eb3f194a43f78e4f5c1065956d17afe8e6ec9c574337b7b5323bcd739739f3cc3e7f59526e9b0619520a0c801b3c44bd926275490f89b9dfa9ae2cbdb
7
+ data.tar.gz: 89c2c6dee8629814800377d27cebfd27fedb7e913130d53810470dfaeec8a7b1bda70d8cf018bab1b85a49e1178c43e39febbf44fc2050dbac6cfee2d44ccb86
@@ -45,10 +45,11 @@
45
45
 
46
46
  if (state || locallyLoggedIn) {
47
47
  self.loggedIn = true;
48
+ var expire = state && (state.expires_at - time <= offset);
48
49
 
49
- if (state && state.expires_at - time > offset) {
50
+ if (state && !expire) {
50
51
  checkState(state.state);
51
- } else if (!state && locallyLoggedIn) {
52
+ } else if (expire || (!state && locallyLoggedIn)) {
52
53
  /**
53
54
  * This branch is executed in two cases:
54
55
  *
@@ -49,7 +49,7 @@ module LobbyBoy
49
49
  else
50
50
  host_name opts[:host]
51
51
  end
52
- opts[:refresh_offset] ||= 60.seconds
52
+ opts[:refresh_offset] ||= 120.seconds
53
53
  opts[:refresh_interval] ||= 30.seconds
54
54
  opts[:logged_in] ||= lambda { false }
55
55
 
@@ -42,8 +42,14 @@ module LobbyBoy
42
42
  origin =~ /#{script_name}\/session\/state/
43
43
  end
44
44
 
45
+ ##
46
+ # Authentication with &prompt=none fails if the user is not already signed in
47
+ # with the respective provider. Retry without &prompt=none in that case.
48
+ #
49
+ # Google responds with 'immediate_failed' in that case.
50
+ # Our own concierge with 'interaction_required'.
45
51
  def retry?
46
- error.message == 'interaction_required'
52
+ ['immediate_failed', 'interaction_required'].include? error.message
47
53
  end
48
54
 
49
55
  def retry_interactive
@@ -1,3 +1,3 @@
1
1
  module LobbyBoy
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
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.1
4
+ version: 0.1.2
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-07-07 00:00:00.000000000 Z
11
+ date: 2015-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails