strongmind-auth 0.1.0 → 1.0.1
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: e98b43c5f33e496befb6df72f2aaa559132d7827fc4e5c5c0e38a032a16184c1
|
4
|
+
data.tar.gz: b7e6517e30acc303c5031aea42ae079459d54735a93c1ea05a756af30a6055dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2603d879de7134e7463418009d45667a0d3f39412d7ff27cb370de7af61a5fc964553577fcd76b81047f81ad107e862ea5cfc29227be41c6335574b6e20f8813
|
7
|
+
data.tar.gz: a5706db7a96ce11092b20f17df3f85a0dc816ce335b91d2dc85d67ad29236976a0719cb2a6fec68c500329d8172ff14420eba1197eba851b6a3bf23b418bfe30
|
@@ -7,7 +7,7 @@ module Users
|
|
7
7
|
def strongmind
|
8
8
|
auth = request.env['omniauth.auth']
|
9
9
|
User.auth_token_cache = auth
|
10
|
-
@user = User.
|
10
|
+
@user = User.with_credentials(auth)
|
11
11
|
|
12
12
|
session[:refresh_token] = request.env['omniauth.auth'].credentials['refresh_token']
|
13
13
|
flash.delete(:notice)
|
data/app/models/user_base.rb
CHANGED
@@ -5,13 +5,13 @@ class UserBase < ApplicationRecord
|
|
5
5
|
|
6
6
|
self.table_name = 'users'
|
7
7
|
|
8
|
-
def self.
|
9
|
-
|
8
|
+
def self.with_credentials(auth)
|
10
9
|
email = auth.extra.raw_info['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress']
|
11
10
|
user = User.where(uid: auth.uid).first
|
12
11
|
if user.nil?
|
13
12
|
user ||= User.create!(uid: auth.uid, email: email, password: Devise.friendly_token[0, 20])
|
14
13
|
end
|
14
|
+
|
15
15
|
user
|
16
16
|
end
|
17
17
|
|
@@ -1,20 +1,17 @@
|
|
1
1
|
<style>
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
#loading {
|
3
|
+
top: 30vh;
|
4
|
+
margin-left: auto;
|
5
|
+
margin-right: auto;
|
5
6
|
}
|
6
7
|
|
7
|
-
#
|
8
|
-
|
8
|
+
#loading .sm-loader {
|
9
|
+
height: 120px;
|
9
10
|
}
|
10
11
|
|
11
|
-
#loading .sm-
|
12
|
-
|
13
|
-
}
|
12
|
+
#loading .sm-loader img {
|
13
|
+
height: 100%;
|
14
14
|
|
15
|
-
#loading .sm-navbar-container .sm-loader {
|
16
|
-
background: rgb(244, 244, 244);
|
17
|
-
height: 120px;
|
18
15
|
}
|
19
16
|
</style>
|
20
17
|
<%= button_to 'Sign in with StrongMind', '/users/auth/strongmind', style: 'display:none' %>
|
@@ -29,10 +26,9 @@
|
|
29
26
|
});
|
30
27
|
|
31
28
|
</script>
|
32
|
-
<div id="loading"
|
33
|
-
<div class="sm-
|
34
|
-
<
|
35
|
-
<img src="https://prod-backpack-ui.strongmind.com/assets/images/strongmind-loader.svg">
|
36
|
-
</div>
|
29
|
+
<div id="loading">
|
30
|
+
<div class="sm-loader">
|
31
|
+
<img src="https://prod-backpack-ui.strongmind.com/assets/images/strongmind-loader.svg">
|
37
32
|
</div>
|
33
|
+
|
38
34
|
</div>
|