strongmind-auth 0.1.0 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bfec369dd5d286f52bf4d92ceb70f98c982e48f285f4a4aec6dd70b692d9cfe
4
- data.tar.gz: 63e592b1ea89f506d2b08a67abf796c9ba1d9330128ea2b08a4d3207d1da2fb7
3
+ metadata.gz: 858a24af8bdc82d60c187a237ce0f9012aca8ca0aafea595d55ba05c4bd30dcd
4
+ data.tar.gz: a36d21bdee8b7f7baad95bb763cee7233658727c7dfa4e8511f98eb28edda262
5
5
  SHA512:
6
- metadata.gz: de89b183da5f424ea38523f36753fd8ee828031b714426e58df4b58da1c72adcd4d6ed0185da57168d49160a063cce0da56be5dccd33858af29083d921778b2a
7
- data.tar.gz: 7f6eb8fb6151a463fa98138200ae5a53ecc08a2a16328b724d6246cbbf2e13e590b9062294a347ea475ab654c9a075357d887ebf2ca081539a326e9e815720a1
6
+ metadata.gz: 4176c666a31033ec33658b7138ed3e13787dd3a03c58f31d80f69211e367d45b469fa2ba4f42bd0b65ba54b6bf7235b455df520f592af98bde878b3a494ce95b
7
+ data.tar.gz: 6bad2f62194ed2adeec7cae1dfc664b571f2d915683b1966c614adc2e1f2997bf2d7a0ab234f8062f403979fa837d861c99cc38be386c69dbcc1d448c58dce87
@@ -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,26 +1,23 @@
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' %>
21
18
  <script type="text/javascript">
22
19
  function submitForm() {
23
- document.forms[0].submit();
20
+ //document.forms[0].submit();
24
21
  }
25
22
 
26
23
  // Submit the form on load
@@ -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.0"
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.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Belding