sso-auth 0.0.8 → 0.0.9

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: e1ac82b44d74589c2f067f11d743bc799cbff47e
4
- data.tar.gz: 0e121c9db9e302fd40e672c161a242e68b1a2ae8
3
+ metadata.gz: f4de8fe256c9ce031080bbd09fce280ab0b785c5
4
+ data.tar.gz: 65dcf7372a52fd0186fe257c53e6f41a8136f4c0
5
5
  SHA512:
6
- metadata.gz: 0af5ab0dfb2cb4bc6dd441a6fbb5685044a5d97bcbd17681860861802966d0f6c894a95a72dcc0bb21604431f8415e9021d2cf25fa220b97d06c5fd3622de13c
7
- data.tar.gz: c92bc6d4d6c410150d7a1d7f9ed0384a31687b27ac3fc0e530a799c7af2297c9ff453709093dc1817e607772eba2b1d5c034136b568ebf3c95b69eeb6fe87133
6
+ metadata.gz: 281bfa3241b00129f4082b845979ca67bf5d542f20e0bd632d0ae8b45ff72859eb83118fcdef4770ae4c0c39b10432632ae7cf6d5f2ffcd7aee3ce135541522a
7
+ data.tar.gz: ab6e79841efec99d55a24cf85ccc64540d86180964ebc31b749a0d364570c353c3c0c25d4c88b5562a29b3f554ba1ab0d199fe531a9cf21692aa0531a6199bb2
@@ -84,6 +84,7 @@ module Sso
84
84
  user.after_oauth_authentication
85
85
  user
86
86
  end
87
+ rewrite_devise_session_methods
87
88
  end
88
89
 
89
90
  def self.sso_auth_permission(options)
@@ -101,6 +102,17 @@ module Sso
101
102
  scope :for_role, ->(role) { where(:role => role) }
102
103
  scope :for_context, ->(context) { where(:context_id => context.try(:id), :context_type => context.try(:class)) }
103
104
  end
105
+
106
+ define_singleton_method :rewrite_devise_session_methods do
107
+ def self.serialize_into_session(record)
108
+ [record.uid, record.authenticatable_salt]
109
+ end
110
+
111
+ def self.serialize_from_session(key, salt)
112
+ record = find_by(:uid => key)
113
+ record if record && record.authenticatable_salt == salt
114
+ end
115
+ end
104
116
  end
105
117
  end
106
118
  end
@@ -1,5 +1,5 @@
1
1
  module Sso
2
2
  module Auth
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sso-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - http://openteam.ru
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-28 00:00:00.000000000 Z
11
+ date: 2014-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cancan
@@ -213,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
213
  version: '0'
214
214
  requirements: []
215
215
  rubyforge_project:
216
- rubygems_version: 2.2.1
216
+ rubygems_version: 2.2.2
217
217
  signing_key:
218
218
  specification_version: 4
219
219
  summary: Summary of SsoAuth.