strongmind-auth 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/user_base.rb +3 -11
- data/lib/strongmind/auth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2306b7e1bd1a267836f1fef6f86f79233f31c12cd5dcb792332d822f0ad48b7a
|
|
4
|
+
data.tar.gz: 28f82b40cd09b68cd707d44f3da9db20050a7696576fa132f095ea730df1dbd8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80a6b9990e257f8ce2c3a5a3cd84a52a6531cfbaeafaabcff14e6db4595143c5ddd0d33d24c4766c05fba0ee0f7a7e1ba1ea1fe462293d2ee463bd007c47c596
|
|
7
|
+
data.tar.gz: dfe36023e2f0cfac32111a853748cc01a7822959b1702416cbb3f8ee2d08f58afda4cc2ea7f80b6746b47fd9f9da3395f2a24cbf9f0424a25dc9e94d1799d91f
|
data/app/models/user_base.rb
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
class UserBase < ApplicationRecord
|
|
2
|
-
devise :database_authenticatable, :
|
|
3
|
-
:recoverable, :rememberable, :validatable,
|
|
4
|
-
:omniauthable, :omniauth_providers => %i[strongmind]
|
|
2
|
+
devise :database_authenticatable, :omniauthable, :omniauth_providers => %i[strongmind]
|
|
5
3
|
|
|
6
4
|
self.table_name = 'users'
|
|
7
5
|
|
|
8
6
|
def self.with_credentials(auth)
|
|
9
|
-
|
|
10
|
-
user = User.where(uid: auth.uid).first
|
|
11
|
-
if user.nil?
|
|
12
|
-
user ||= User.create!(uid: auth.uid, email: email, password: Devise.friendly_token[0, 20])
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
user
|
|
7
|
+
User.find_or_create_by(uid: auth.uid)
|
|
16
8
|
end
|
|
17
9
|
|
|
18
10
|
def self.auth_token_cache=(auth)
|
|
@@ -28,7 +20,7 @@ class UserBase < ApplicationRecord
|
|
|
28
20
|
def auth_token_cache
|
|
29
21
|
Rails.cache.read(uid)
|
|
30
22
|
end
|
|
31
|
-
|
|
23
|
+
|
|
32
24
|
def authenticatable_salt
|
|
33
25
|
return super unless session_token
|
|
34
26
|
|