admin_auth 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzVkZjM2NTExOWIyNmQyOWZmMmMyYTI4MzI5ZmVhNTYzNWM5MGZkMw==
4
+ NjIwNjQ0ZmVhZjI4NTJhNWFmNjI4ZjJkODg5ZmRlYzViZWQ4MjAzYg==
5
5
  data.tar.gz: !binary |-
6
- ZjYxNGY3OTU1ZTU3NjFlN2FlZWFjNmEwOTgyZGY4ODU5NDYwMzI5OQ==
6
+ NTZiZWZiNDcxYzBmMGFiZjBhNzZiZTY2ZTJlNjViYjQ2YzNhYTgzZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODUwZmJlNmFiYjE1ZmQxNGMxODkzODUxMTI4YmQxYzFjMzk3OGFmNzViMzEx
10
- YmUxOTBhYzVkY2E1ZWUwYmIxY2RiNDhkN2JmMTE0MzE5ZGQ3MDgxYTkwYjc5
11
- MDVjZDNhZTJjNmE5OWZmODczNDQ1NTI4NWQxN2NjNzg3YjczNDI=
9
+ ZjYxNWIwYWY5NDA5OWU0ZDUwZjZlOTk1MGE1MzUyNWQxOGMzNjY2NGY1Yjky
10
+ OGFmYmRhOGY4MWFjMGFkZjI3ZmRlNmFjNzQxMmFlZTZkODU1ZGUzMzVmZDBk
11
+ NmEzMzU1N2ZiNzU1NjMxZDFiM2IxN2RkN2E2NTg4YWM2YTBkMTA=
12
12
  data.tar.gz: !binary |-
13
- NTQ0Y2U5ODE2N2UwNWNiNDMxYTU2YmMyOTY0MjYyYTFhNWMzN2RlYjRlNWZj
14
- MjMwMTliMTE5YjNkY2ZhZjE5OWE2MzViODQ3NzdkMjc4MmRjZWVhNmRlMzM0
15
- OWFkNGE3YzQwMGU3YTQ1ZjVhNzYwMTAzZGRiYjhjN2MwOWY4MDk=
13
+ Njc1ZDkxZjQwZDU0ZjFkYTEyNjFkNWZlNDczMmY4ODJhMDQxYzQzNzM5MDAx
14
+ NTllNTA4YzBkYzg3MGZkNzZiOTEzMzcwNjU2ZGM0ZDY2NGMyYTQ3YWJiODJl
15
+ ZWZiZGIyMGE2YzUzZWE0NmRjMmM0NThiMDhjMDk1Y2QyZDExODg=
data/README.md CHANGED
@@ -32,8 +32,8 @@ To use this gem you need to do few things:
32
32
  2. Add the line `admin_auth_routes` to your `routes.rb` file.
33
33
  3. Now if you add `before_action authenticate_admin!` to any controller it will send the user to the admin login page.
34
34
  4. To create an admin you will need to do it in the rails console: `Admin.create(email: 'email@email.com', password: 'password', password_confirmation: 'password')`
35
- 5. Optionally, add an `after_login_path` method to your `ApplicationController` that returns the path you want to redirect to when logged in.
36
- 6. Optionally, add an `after_logout_path` method to your `ApplicationController` that returns the path you want to redirect to after logout.
35
+ 5. Optionally, add an `after_login_path(locale = nil)` method to your `ApplicationController` that returns the path you want to redirect to when logged in.
36
+ 6. Optionally, add an `after_logout_path(locale = nil)` method to your `ApplicationController` that returns the path you want to redirect to after logout.
37
37
  7. Optionally, you can copy the views in the gem to `app/views/admin` and modify then how you see fit.
38
38
 
39
39
  ## Contributing
@@ -1,6 +1,6 @@
1
1
  module AdminAuth
2
2
  class Railtie < ::Rails::Railtie
3
- config.after_initialize do
3
+ initializer :admin_auth do
4
4
  ::ApplicationController.include(AdminAuth::Controller) rescue nil
5
5
  ::Admin.include(AdminAuth::Model) rescue nil
6
6
  end
@@ -1,3 +1,3 @@
1
1
  module AdminAuth
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe AdminAuth::Engine do
4
+ subject { AdminAuth::Railtie }
5
+
6
+ describe 'initializer added' do
7
+ it { expect(subject.initializers.map(&:name)).to include :admin_auth }
8
+ end
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admin_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phillip Boksz
@@ -142,6 +142,7 @@ files:
142
142
  - spec/lib/admin_auth/encryptor_spec.rb
143
143
  - spec/lib/admin_auth/engine_spec.rb
144
144
  - spec/lib/admin_auth/model_spec.rb
145
+ - spec/lib/admin_auth/railtie_spec.rb
145
146
  - spec/lib/admin_auth/repository_spec.rb
146
147
  - spec/lib/admin_auth/routes_spec.rb
147
148
  - spec/spec_helper.rb
@@ -174,6 +175,7 @@ test_files:
174
175
  - spec/lib/admin_auth/encryptor_spec.rb
175
176
  - spec/lib/admin_auth/engine_spec.rb
176
177
  - spec/lib/admin_auth/model_spec.rb
178
+ - spec/lib/admin_auth/railtie_spec.rb
177
179
  - spec/lib/admin_auth/repository_spec.rb
178
180
  - spec/lib/admin_auth/routes_spec.rb
179
181
  - spec/spec_helper.rb