mumukit-login 6.1.3 → 6.1.4

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: cc75ada29a39f0529db440916684fc738bcad0f5df7bb7f6c08b66ff095cc0ec
4
- data.tar.gz: d3057603ef94b83965f10b7740aa8b84b618015218f13129ff95ed5b60b00157
3
+ metadata.gz: 37959b71c7f72904623b2db83e2f2562552687236ad5bab307e6ae3c199e5d92
4
+ data.tar.gz: 18ea3556374cf43691c12fcb078d40e94dd3d52118ad3429ac41576efa3d7354
5
5
  SHA512:
6
- metadata.gz: 3d8f380752de6a1764a01a6060b5a2864bfd7fc4e8605015bf4261625fdd82b3cf2e90ae0bd711edbb5d325a4187e6bd3b9c35937bfdeaf49c65eb06906cf10e
7
- data.tar.gz: 4c095af1ab8b0ea0d9d7109b4f1cbb6693699c1c27a5e394e74448b86c090a5f82757217a1053ac00cab58ceb0396687b3f1459bc04fc5d8c02e3390e9d04bde
6
+ metadata.gz: 1f37dc8fa5ff59eaa930ebfcbb4b47f8221bb04b61b90b55bf3a0c9b813540b13ccb152235ebe70f892a2d52a4c7442a490b2e3c2c3d3778f2687592ae4508e4
7
+ data.tar.gz: 1790e80e4e86c17ead8decc5f0792222b7353bfe9f0feb8177ee669f7b59cb8a100411916debf68934e67fd86b28958723a8585f5cab0311ab0e9556a1396328
@@ -1,6 +1,7 @@
1
1
  module Mumukit::Login::LoginControllerHelpers
2
2
 
3
3
  def login_current_user!
4
+ mumukit_controller.write_cookie!(:login_organization, organization_name)
4
5
  origin_redirector.save_after_login_location!
5
6
  if current_user?
6
7
  origin_redirector.redirect_after_login!
@@ -48,17 +48,12 @@ class Mumukit::Login::Provider::Base
48
48
  def setup_proc
49
49
  proc do |env|
50
50
  options = env['omniauth.strategy'].options
51
-
52
- effective_settings = default_settings.to_h.merge(current_organization_settings)
51
+ effective_settings = default_settings.to_h.merge(setup_phase_login_settings(env))
53
52
  options.merge!(effective_settings)
54
53
  options.merge!(computed_settings(effective_settings.to_struct))
55
54
  end
56
55
  end
57
56
 
58
- def current_organization_settings
59
- Mumukit::Platform::Organization.current.login_provider_settings || {}
60
- end
61
-
62
57
  # Default provider settings that come from the environment
63
58
  #
64
59
  # Override this method in order to read ENV and in order to provide default settings
@@ -82,6 +77,18 @@ class Mumukit::Login::Provider::Base
82
77
 
83
78
  private
84
79
 
80
+ def setup_phase_login_settings(env)
81
+ organization_login_settings_for setup_phase_login_organization_name(env)
82
+ end
83
+
84
+ def setup_phase_login_organization_name(env)
85
+ Rack::Request.new(env).cookies['login_organization']
86
+ end
87
+
88
+ def organization_login_settings_for(name)
89
+ Mumukit::Platform::Organization.find_by_name!(name).login_provider_settings || {}
90
+ end
91
+
85
92
  def create_uri(path, query_values)
86
93
  uri = Addressable::URI.heuristic_parse path
87
94
  uri.query_values = query_values if query_values.present?
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Login
3
- VERSION = '6.1.3'
3
+ VERSION = '6.1.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-login
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.3
4
+ version: 6.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli