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: 9bfec369dd5d286f52bf4d92ceb70f98c982e48f285f4a4aec6dd70b692d9cfe
4
- data.tar.gz: 63e592b1ea89f506d2b08a67abf796c9ba1d9330128ea2b08a4d3207d1da2fb7
3
+ metadata.gz: e98b43c5f33e496befb6df72f2aaa559132d7827fc4e5c5c0e38a032a16184c1
4
+ data.tar.gz: b7e6517e30acc303c5031aea42ae079459d54735a93c1ea05a756af30a6055dd
5
5
  SHA512:
6
- metadata.gz: de89b183da5f424ea38523f36753fd8ee828031b714426e58df4b58da1c72adcd4d6ed0185da57168d49160a063cce0da56be5dccd33858af29083d921778b2a
7
- data.tar.gz: 7f6eb8fb6151a463fa98138200ae5a53ecc08a2a16328b724d6246cbbf2e13e590b9062294a347ea475ab654c9a075357d887ebf2ca081539a326e9e815720a1
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.from_omniauth(auth)
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)
@@ -5,13 +5,13 @@ class UserBase < ApplicationRecord
5
5
 
6
6
  self.table_name = 'users'
7
7
 
8
- def self.from_omniauth(auth)
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
- /* Hide login error */
3
- .sm-alert-error {
4
- display: none;
2
+ #loading {
3
+ top: 30vh;
4
+ margin-left: auto;
5
+ margin-right: auto;
5
6
  }
6
7
 
7
- #header .sm-loader img {
8
- visibility: hidden;
8
+ #loading .sm-loader {
9
+ height: 120px;
9
10
  }
10
11
 
11
- #loading .sm-navbar-container {
12
- top: 30vh;
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" class="w-full items-center justify-center">
33
- <div class="sm-navbar-container">
34
- <div class="sm-loader bg-[#151515] h-[62px] p-4">
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>
@@ -1,2 +1,7 @@
1
1
  class User < UserBase
2
+
3
+ def self.with_credentials(auth)
4
+ # Override this method to handle the lookup/creation of a user from an omniauth response
5
+ super
6
+ end
2
7
  end
@@ -1,5 +1,5 @@
1
1
  module Strongmind
2
2
  module Auth
3
- VERSION = "0.1.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongmind-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Belding