mumukit-login 7.4.2 → 7.6.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: 9936c36470aad69a4573c77067305f4f1cc689657f3e853cad2c67fa9cf655db
4
- data.tar.gz: 13566888f54e440dd75d6122262aaf66cd8e4e817d35433db9d1a62565172b94
3
+ metadata.gz: ea14b08cb8fdd0293ed453c1cadf528ed8e0288248d6a679624c7d2664506cd4
4
+ data.tar.gz: 23dab9bd078767f1dd99e240e9464507175bb6e2c4d2d986de997d6a34963c84
5
5
  SHA512:
6
- metadata.gz: 416fd94bf5d2344ea837a8edca52ef9e023b72e4b7b67af45a70c5bd6d4b95a0d456d5f0260c207a0a41a2ee714569998ebdb117da1816c6d6064d09bedcf39d
7
- data.tar.gz: 8f7bd5f3152b4624de431567f937facb9a57cdb2c7fd5782c970ad4e8db034e9c11671cb000a8e9361f25542b6a1c7f609664b65eccdedca12eaef7fa00fc657
6
+ metadata.gz: 3539bab238494b8518a79fa00d18b8b57c9f50c6678c36e290903c617d6e402ccb433bc4db6ff5256cbfccc03fc04552142ebe1fd46d4693c56c3e418bf4d163
7
+ data.tar.gz: a327e8970ad15b96e16eeb98daadd7f46b07772ec532ece543bff8ea0d0932c9be544e7807e3e75d0d9feee5a646511f813cdc7144eca3f7abdff52b83f0c0a1
@@ -15,5 +15,11 @@ module Mumukit::Login::AuthorizationHelpers
15
15
  current_user.has_permission? role, authorization_slug
16
16
  end
17
17
 
18
+ Mumukit::Auth::Roles::ROLES.each do |role|
19
+ define_method "authorize_#{role}!" do
20
+ authorize! role
21
+ end
22
+ end
23
+
18
24
  required :authorization_slug
19
25
  end
@@ -11,10 +11,14 @@ module Mumukit::Login::Profile
11
11
  social_id: omniauth.uid,
12
12
  email: omniauth.info.email,
13
13
  uid: generate_uid(omniauth),
14
- image_url: omniauth.info.image
14
+ image_url: image_url(omniauth.info.image)
15
15
  }.compact
16
16
  end
17
17
 
18
+ def self.image_url(url)
19
+ url if url.try { size <= 255 }
20
+ end
21
+
18
22
  def self.generate_uid(omniauth)
19
23
  Mumukit::Login::Provider.parse_login_provider(omniauth.provider).uid_for_profile(omniauth)
20
24
  end
@@ -28,9 +28,11 @@ HTML
28
28
  end
29
29
 
30
30
  def footer_html(*)
31
- '<a href="https://auth0.com/" target="_blank">
31
+ '<div class="mu-footer-login-provider">
32
+ <a href="https://auth0.com/" target="_blank">
32
33
  <img height="40" alt="JWT Auth for open source projects" src="//cdn.auth0.com/oss/badges/a0-badge-light.png"/>
33
- </a>'
34
+ </a>
35
+ </div>'
34
36
  end
35
37
 
36
38
  private
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Login
3
- VERSION = '7.4.2'
3
+ VERSION = '7.6.1'
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: 7.4.2
4
+ version: 7.6.1
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: 2020-10-02 00:00:00.000000000 Z
11
+ date: 2021-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -226,14 +226,14 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '5.0'
229
+ version: '7.0'
230
230
  type: :runtime
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '5.0'
236
+ version: '7.0'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: actionpack
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -305,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
305
  - !ruby/object:Gem::Version
306
306
  version: '0'
307
307
  requirements: []
308
- rubygems_version: 3.0.8
308
+ rubygems_version: 3.0.3
309
309
  signing_key:
310
310
  specification_version: 4
311
311
  summary: Library for login mumuki requests