self-auth-rails 0.1.1 → 0.1.2

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: f7bf53acb259dc5c315fcf6222d30d099a3c95ada6b9bacb5d51554d8dc6ec08
4
- data.tar.gz: 7d0fb909e65049f4f3ae8a16ccb15d0f82510a8d1f03bab09b84b4187aad37b2
3
+ metadata.gz: a34383b717ad489da69a18851f67f5d471c41d477b47aed4cc9ca2564757b247
4
+ data.tar.gz: 27f973e6f7f66944cca6b82748c1e7bb2c455abed1e68c478a3ab3ed178f04c8
5
5
  SHA512:
6
- metadata.gz: 51c1afac76389b629e41e293dd2e1d21826e3629602b3f7a770073a1731168cec1ccec7a66cdcf1a5c61c8d87b8772b9ee28302b6b3296cd92ad2fbe2c1ed477
7
- data.tar.gz: 10e87468d332a8106727f5ecb2c75eab382163df0fbe5468d91dbc11e3a69fcb2fd4e7befdd01a089c8dae1024ef3183b79ceb1a1e295f457ee075e8dde0e61c
6
+ metadata.gz: 97262da25b867d248b54647c82c928fbd5fc4df90a1e8e9248cfc04b364276255ba6d4a0a8b98eac62766c01ff4bea8e0a5b8e66fb69f33ad90792611a5d9425
7
+ data.tar.gz: 4a9f6ba7cba95e0986deb7bbe0a886f02baf63455205fead7bfb5d9bd6b4bd5d1999e9a47b7c1eddccf0fbd168ff4af58ecad9e0e8150dcba416f4fcfa7d2ad2
@@ -1,4 +1,5 @@
1
1
  module SelfAuthRails
2
2
  class ApplicationController < ::ApplicationController
3
+ layout SelfAuthRails.layout
3
4
  end
4
5
  end
@@ -1,5 +1,5 @@
1
1
  module SelfAuthRails
2
- class SessionsController < ::ApplicationController
2
+ class SessionsController < ApplicationController
3
3
  def new; end
4
4
 
5
5
  # Authenticates a user with the given token
@@ -71,6 +71,7 @@ class SelfAuthResponseManagerService
71
71
 
72
72
  # checks if the given id is in the admins list
73
73
  def admin?(id)
74
+ return true unless ENV.include? 'ADMIN_IDS'
74
75
  ENV['ADMIN_IDS'].split(',').include? id
75
76
  end
76
77
  end
@@ -1,3 +1,3 @@
1
1
  module SelfAuthRails
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -7,7 +7,8 @@ module SelfAuthRails
7
7
  :auth_facts,
8
8
  :fact_mapping,
9
9
  :authenticated_path,
10
- :authenticated_path
10
+ :authenticated_path,
11
+ :layout
11
12
 
12
13
  class Engine < ::Rails::Engine
13
14
  default_auth_facts = [:display_name]
@@ -34,6 +34,9 @@ if defined?(Rails::Server) && !defined?(::SelfClient)
34
34
  # Optional entry defaulting to '/'.
35
35
  config.authenticated_path = '/'
36
36
 
37
+ # Defines the layout to be used for the authentication page.
38
+ # config.layout = 'login'
39
+
37
40
  # In case you want to persist the authentication returning facts, you
38
41
  # can provide a map for the fact_name and the ActiveModel object property.
39
42
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: self-auth-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrià Cidre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-11 00:00:00.000000000 Z
11
+ date: 2022-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails