mumukit-login 2.0.2 → 2.0.3

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
  SHA1:
3
- metadata.gz: ae077ab39db6a0b0f79ed6b997b34b509086f7b0
4
- data.tar.gz: e3b16642385f0813a0530b39c448c2dbe6234e94
3
+ metadata.gz: c492a7ab4a7c1a61cb22be1a8578dbea44c7cb6a
4
+ data.tar.gz: 72709766299442d058f90571ccbf77724476417b
5
5
  SHA512:
6
- metadata.gz: b18675db8ded91a87d1ce5ca96bcad7cd0775bd8a9b1ce3393c03bec06bc248c0837e55d5de711585cd9a011244396975f425fc12e6aa16a9a8e20c5a7ab8cd8
7
- data.tar.gz: 0cab043d272a9acf4734e47e41361dba026c50b897247673e10531192cf8f4b27a05e0b8a89142a731fe6772de155fd6ada196ae137e31e2bbf5b61181077e18
6
+ metadata.gz: b7c018fdff599d52b6a4a1ea33315416de557621b20484657f337603f3df82bdc3985ac8d752cf685a919b4fcf26b9e6255d4616202682ecdd8502fe132c5e80
7
+ data.tar.gz: 08dd0e4d9565e5a1f42f7eb25948169b960e02f043b1737c4ef2de5908eadd170a2b3d260f721afc6584517878d8a3fb2ab5759451f29badd4a1939f73e76347
@@ -25,8 +25,8 @@ module Mumukit::Login::Framework::Rails
25
25
  rails_controller.redirect_to path
26
26
  end
27
27
 
28
- def self.render_html!(content, rails_controller)
29
- rails_controller.render html: content.html_safe, layout: true
28
+ def self.render_html!(html, rails_controller)
29
+ rails_controller.render html: html[:body].html_safe, layout: true
30
30
  end
31
31
 
32
32
  # Configures the login routes.
@@ -19,8 +19,13 @@ module Mumukit::Login::Framework::Sinatra
19
19
  sinatra_handler.redirect path
20
20
  end
21
21
 
22
- def self.render_html!(content, sinatra_handler)
23
- content
22
+ def self.render_html!(html, sinatra_handler)
23
+ <<HTML
24
+ <html>
25
+ <head>#{html[:header]}</head>
26
+ <body>#{html[:body]}</body>
27
+ </html>
28
+ HTML
24
29
  end
25
30
 
26
31
  def self.configure_login_routes!(sinatra_module)
@@ -9,11 +9,8 @@ class Mumukit::Login::Provider::Auth0 < Mumukit::Login::Provider::Base
9
9
 
10
10
  def request_authentication!(controller, login_settings)
11
11
  settings = lock_settings(controller, login_settings, {closable: false})
12
- controller.render_html! <<HTML
13
- <script type="text/javascript">
14
- new Auth0Lock('#{auth0_config.client_id}', '#{auth0_config.domain}', JSON.parse('#{settings}')).show();
15
- </script>
16
- HTML
12
+ controller.render_html! header: header_html,
13
+ body: script_html(settings)
17
14
  end
18
15
 
19
16
  def header_html(*)
@@ -23,6 +20,14 @@ HTML
23
20
  HTML
24
21
  end
25
22
 
23
+ def script_html(settings)
24
+ <<HTML
25
+ <script type="text/javascript">
26
+ new Auth0Lock('#{auth0_config.client_id}', '#{auth0_config.domain}', JSON.parse('#{settings}')).show();
27
+ </script>
28
+ HTML
29
+ end
30
+
26
31
  def footer_html(*)
27
32
  '<a href="https://auth0.com/" target="_blank">
28
33
  <img height="40" alt="JWT Auth for open source projects" src="//cdn.auth0.com/oss/badges/a0-badge-light.png"/>
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Login
3
- VERSION = '2.0.2'
3
+ VERSION = '2.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-login
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-12 00:00:00.000000000 Z
11
+ date: 2017-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler