brycesch-devise_oauth2_providable 1.2.4 → 1.2.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5828131303ddc5fc22d7cad94d85175ccec490b8
|
4
|
+
data.tar.gz: de7cd32f42c9e9de1457f65935d3c64fd183fbd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 680abaa16b01f33b5699159683d720e220d7ccfc75c207f6c297a2fb916f1d266448ced6d6f5fc9afd4cd580a5cb3ec7f46423307e6eadec1eceb30e13392101
|
7
|
+
data.tar.gz: fbcfce9dd05a30d89211c8b02746ae4342f96bbb5583b8a19a97659e4b535310fd3230581a6ff9818c04fed18d2370177d9736e7a595df78c5cf4e8a0ec5ee68
|
@@ -4,9 +4,6 @@ class Devise::Oauth2Providable::AccessToken < ActiveRecord::Base
|
|
4
4
|
before_validation :restrict_expires_at, :on => :create, :if => :refresh_token
|
5
5
|
belongs_to :refresh_token
|
6
6
|
|
7
|
-
scope :unexpired, -> { where('expires_at > ?', Time.zone.now) }
|
8
|
-
scope :user_id, ->(user_id){ where(user_id: user_id) }
|
9
|
-
|
10
7
|
def token_response
|
11
8
|
response = {
|
12
9
|
:access_token => token,
|
@@ -10,7 +10,7 @@ class Devise::Oauth2Providable::Client < ActiveRecord::Base
|
|
10
10
|
validates :identifier, :presence => true, :uniqueness => true
|
11
11
|
|
12
12
|
def expire_tokens_for_user(user)
|
13
|
-
access_tokens.
|
13
|
+
access_tokens.where(user_id: user.id).where('expires_at > ?', Time.zone.now).update_all(expires_at: Time.zone.now)
|
14
14
|
end
|
15
15
|
|
16
16
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brycesch-devise_oauth2_providable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Sonnek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|