strongmind-auth 1.0.16 → 1.0.17

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: 2306b7e1bd1a267836f1fef6f86f79233f31c12cd5dcb792332d822f0ad48b7a
4
- data.tar.gz: 28f82b40cd09b68cd707d44f3da9db20050a7696576fa132f095ea730df1dbd8
3
+ metadata.gz: 75836642566646ba7a5100a9daedb353288906cf4fbfe229ff73d3217cc12797
4
+ data.tar.gz: 7907e3c46d657c5776edfd4fd4540b8643309607bee7a5dd616412f72f424e12
5
5
  SHA512:
6
- metadata.gz: 80a6b9990e257f8ce2c3a5a3cd84a52a6531cfbaeafaabcff14e6db4595143c5ddd0d33d24c4766c05fba0ee0f7a7e1ba1ea1fe462293d2ee463bd007c47c596
7
- data.tar.gz: dfe36023e2f0cfac32111a853748cc01a7822959b1702416cbb3f8ee2d08f58afda4cc2ea7f80b6746b47fd9f9da3395f2a24cbf9f0424a25dc9e94d1799d91f
6
+ metadata.gz: 21b444fbafe788e90b97da758d4bd6f0214764cf3910e1ec5b2765a8ac6a93422a92df009513231b6d1905b52a580b2d528eb47f06026b2b08400b35107bcfb8
7
+ data.tar.gz: 9fd3e496c494fa37c1a1602b7890c28f744e9510b3e4c74990df8b09a46e90e3cfcf90fa8b807e6e0c3299ba141b682926c10dfc2d58b9fe52469cd777c55583
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require "bundler/setup"
2
2
 
3
- APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
3
+ APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
4
4
  load "rails/tasks/engine.rake"
5
5
 
6
6
  load "rails/tasks/statistics.rake"
@@ -14,8 +14,8 @@ module StrongMindNav
14
14
  rescue Strongmind::Exceptions::TokenNotFoundError, Strongmind::Exceptions::UserNotFoundError => e
15
15
  Sentry.capture_exception(e)
16
16
  Rails.logger.error(e)
17
- flash[:alert] = e.inspect if Rails.env.development?
18
- @stop_redirect = true if Rails.env.development?
17
+ flash[:alert] = e.inspect if Rails.env.development? || Rails.env.test?
18
+ @stop_redirect = true if Rails.env.development? || Rails.env.test?
19
19
  render 'logins/index'
20
20
  rescue Exception => e
21
21
  Sentry.capture_exception(e)
@@ -16,16 +16,11 @@
16
16
  </style>
17
17
  <%= button_to 'Sign in with StrongMind', '/users/auth/strongmind', style: 'display:none' %>
18
18
  <script type="text/javascript">
19
- function submitForm() {
20
- document.forms[0].submit();
21
- }
22
-
23
19
  // Submit the form on load
24
20
  window.addEventListener("load", (event) => {
25
- <% if @stop_redirect %>
26
- return;
21
+ <% unless @stop_redirect %>
22
+ document.forms[0].submit();
27
23
  <% end %>
28
- submitForm();
29
24
  });
30
25
 
31
26
  </script>
@@ -1,6 +1,11 @@
1
1
  module Strongmind
2
2
  module Auth
3
3
  class Engine < ::Rails::Engine
4
+ config.generators do |g|
5
+ g.test_framework :rspec
6
+ g.fixture_replacement :factory_bot
7
+ g.factory_bot dir: 'spec/factories'
8
+ end
4
9
  end
5
10
  end
6
11
  end
@@ -1,5 +1,5 @@
1
1
  module Strongmind
2
2
  module Auth
3
- VERSION = "1.0.16"
3
+ VERSION = "1.0.17"
4
4
  end
5
5
  end
@@ -12,6 +12,9 @@ module Strongmind
12
12
  def initialize(user, request)
13
13
  raise Strongmind::Exceptions::UserNotFoundError, 'User not found' unless user.present?
14
14
  raise ArgumentError, 'Request not found' unless request.present?
15
+ raise ArgumentError, 'Identity base URL not found at IDENTITY_BASE_URL in environment' unless ENV['IDENTITY_BASE_URL'].present?
16
+ raise ArgumentError, 'Identity client ID not found at IDENTITY_CLIENT_ID in environment' unless ENV['IDENTITY_CLIENT_ID'].present?
17
+ raise ArgumentError, 'Identity client secret not found at IDENTITY_CLIENT_SECRET in environment' unless ENV['IDENTITY_CLIENT_SECRET'].present?
15
18
 
16
19
  @user = user
17
20
  @request = request
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: 1.0.16
4
+ version: 1.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Belding
@@ -94,6 +94,34 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec-rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: factory_bot_rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
97
125
  description: Ruby gem for StrongMind authentication in a strongmind app
98
126
  email:
99
127
  - teambelding@strongmind.com