strongmind-auth 1.0.14 → 1.0.16
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
|
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
|
|
@@ -20,7 +20,7 @@ module Strongmind
|
|
20
20
|
before_action :authenticate_user!
|
21
21
|
before_action :fetch_common_nav
|
22
22
|
|
23
|
-
rescue_from Exceptions::RefreshTokenExpiredError do
|
23
|
+
rescue_from Strongmind::Exceptions::RefreshTokenExpiredError do
|
24
24
|
current_user&.invalidate_all_sessions!
|
25
25
|
redirect_to \"#{ENV['IDENTITY_BASE_URL']}/connect/endsession\", headers: {
|
26
26
|
'Content-Type' => 'application/json'
|
@@ -30,7 +30,7 @@ module Strongmind
|
|
30
30
|
# Implement the list of menu items for the application
|
31
31
|
# def menu_items
|
32
32
|
# [
|
33
|
-
# { name: 'Home', icon: 'fa-solid fa-house',
|
33
|
+
# { name: 'Home', icon: 'fa-solid fa-house', url: root_path }
|
34
34
|
# ]
|
35
35
|
# end
|
36
36
|
|