admin_auth 0.2.6 → 0.6.0
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 +5 -13
- data/.travis.yml +1 -0
- data/README.md +2 -2
- data/admin_auth.gemspec +5 -8
- data/app/controllers/admin/admins_controller.rb +1 -1
- data/app/views/admin/admins/edit.haml +4 -4
- data/app/views/admin/admins/index.haml +12 -16
- data/app/views/admin/admins/new.haml +5 -5
- data/app/views/admin/sessions/new.haml +4 -4
- data/lib/admin_auth/version.rb +1 -1
- data/spec/lib/admin_auth/engine_spec.rb +1 -1
- metadata +25 -68
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZDZjNjdhZWY3ODQ3MTJlNGVhNmU0MDk0NWVkMzMxNWI2YWI0Y2VhZg==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2a177550076e4c7bf76d7babe7df2d50781f90797a7a2a64e8863b8b8a6993d1
|
4
|
+
data.tar.gz: b6dbc7d614ef622bc5f6e5035ab82f9fc69f584ad4bafed967adab928d08c80b
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZWZkMGFhYWY3NGE2ZjFlZDM2NGQwNzYyMWVhYTNjZWRhY2Y2NjAzNWFhNzJi
|
11
|
-
ZDI3YWM3ZjRmNTU4ZTJiZjM1NDFlODhkMjQ1NGY4ZGY4YTgzNWM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MmUyMTgxY2ViOGMxZTVkNjY0MzczYTFlMjM5NjNkNWZiYjgwZTUwNTA2MjEx
|
14
|
-
ZTM2NWU5NjRlYzk3NTUyYjM4ZjJjZTUxYjhjNDg0YzZlNjM0YTExMzAxYjNj
|
15
|
-
ZjU0M2Q4ODJjMzU4MGIxNjZlNTAwODIyYzg1MWM0NTcyOWU2NDk=
|
6
|
+
metadata.gz: c3b1887d01c604566d848ff061083d87f505629bccf3d25b5709c6681d60ca843e27203013b5fece4b60ac2a98c132d2ad593afd9a347ae77a981fe1619645fb
|
7
|
+
data.tar.gz: 710ada79b2f00c83619dca79297e29ee7098fd969a1924db16d65f0dd411c40db76d276725a6030740f19723f15896c28d32b71c426c2da560013d7822f64a25
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -30,7 +30,7 @@ To use this gem you need to do few things:
|
|
30
30
|
- email (string)
|
31
31
|
- encrypted_password (string)
|
32
32
|
2. Add the line `admin_auth_routes` to your `routes.rb` file.
|
33
|
-
3. Now if you add `before_action authenticate_admin!` to any controller it will send the user to the admin login page.
|
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
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
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.
|
@@ -38,7 +38,7 @@ To use this gem you need to do few things:
|
|
38
38
|
|
39
39
|
## Contributing
|
40
40
|
|
41
|
-
1. Fork it ( https://github.com/
|
41
|
+
1. Fork it ( https://github.com/pboksz/admin_auth/fork )
|
42
42
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
43
43
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
44
44
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/admin_auth.gemspec
CHANGED
@@ -17,14 +17,11 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
|
-
spec.required_ruby_version = ">= 2.0"
|
20
|
+
spec.required_ruby_version = ">= 2.0.0"
|
21
21
|
|
22
|
-
spec.add_dependency "bcrypt", "
|
23
|
-
spec.add_dependency "haml", "
|
24
|
-
spec.add_dependency "rails", "~> 4"
|
22
|
+
spec.add_dependency "bcrypt", ">= 3.0.0"
|
23
|
+
spec.add_dependency "haml", ">= 4.0.0"
|
25
24
|
|
26
|
-
spec.add_development_dependency "
|
27
|
-
spec.add_development_dependency "
|
28
|
-
spec.add_development_dependency "pry", "~> 0"
|
29
|
-
spec.add_development_dependency "rspec", "~> 3"
|
25
|
+
spec.add_development_dependency "rails", ">= 4.0.0"
|
26
|
+
spec.add_development_dependency "rspec", ">= 3.0.0"
|
30
27
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
.admin-auth
|
1
|
+
.admin-auth-edit{ style: 'text-align: center' }
|
2
2
|
%h2= 'Edit admin'
|
3
3
|
= form_for admin, url: admin_admin_path(locale, admin), method: :put do |f|
|
4
|
-
.section= f.password_field :password, placeholder: '********'
|
5
|
-
.section= f.password_field :password_confirmation, placeholder: '********'
|
6
|
-
.
|
4
|
+
.admin-auth-section= f.password_field :password, placeholder: '********'
|
5
|
+
.admin-auth-section= f.password_field :password_confirmation, placeholder: '********'
|
6
|
+
.admin-auth-actions= f.submit 'Save'
|
@@ -1,17 +1,13 @@
|
|
1
|
-
.admin-auth
|
2
|
-
%h2
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
.admin-auth-index{ style: 'width: 60%; margin: 0 auto' }
|
2
|
+
%h2
|
3
|
+
= 'Admins'
|
4
|
+
.admin-auth-actions{ style: 'font-weight: normal; font-size: 0.7em; float: right' }
|
5
|
+
= link_to 'Add an Admin', new_admin_admin_path(locale), class: 'button'
|
6
|
+
= link_to 'Change your password', edit_admin_admin_path(locale, current_admin), class: 'button'
|
7
|
+
= link_to 'Logout', admin_logout_path(locale), class: 'button'
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
%tbody
|
13
|
-
- admins.each do |admin|
|
14
|
-
%tr
|
15
|
-
%td= admin.email
|
16
|
-
%td.action= link_to 'Delete', admin_admin_path(locale, admin), method: :delete,
|
17
|
-
data: { confirm: 'Are you sure?' }, class: 'button'
|
9
|
+
- admins.each do |admin|
|
10
|
+
.admin-auth-admin{ style: 'margin-bottom: 1em; border-bottom: 1px dotted black;' }
|
11
|
+
= admin.email
|
12
|
+
= link_to 'Delete', admin_admin_path(locale, admin), method: :delete,
|
13
|
+
data: { confirm: 'Are you sure?' }, class: 'button', style: 'float: right'
|
@@ -1,7 +1,7 @@
|
|
1
|
-
.admin-auth
|
1
|
+
.admin-auth-new{ style: 'text-align: center' }
|
2
2
|
%h2= 'New admin'
|
3
3
|
= form_for admin, url: admin_admins_path(locale), method: :post do |f|
|
4
|
-
.section= f.text_field :email, placeholder: 'email@email.com'
|
5
|
-
.section= f.password_field :password, placeholder: '********'
|
6
|
-
.section= f.password_field :password_confirmation, placeholder: '********'
|
7
|
-
.
|
4
|
+
.admin-auth-section= f.text_field :email, placeholder: 'email@email.com'
|
5
|
+
.admin-auth-section= f.password_field :password, placeholder: '********'
|
6
|
+
.admin-auth-section= f.password_field :password_confirmation, placeholder: '********'
|
7
|
+
.admin-auth-actions= f.submit 'Save'
|
@@ -1,6 +1,6 @@
|
|
1
|
-
.admin-auth
|
1
|
+
.admin-auth-login{ style: 'text-align: center' }
|
2
2
|
%h2= 'Admin login'
|
3
3
|
= form_for admin, url: admin_login_path(locale), method: :post do |f|
|
4
|
-
.section= f.text_field :email, autofocus: true, placeholder: 'email@email.com'
|
5
|
-
.section= f.password_field :password, placeholder: '********'
|
6
|
-
.
|
4
|
+
.admin-auth-section= f.text_field :email, autofocus: true, placeholder: 'email@email.com'
|
5
|
+
.admin-auth-section= f.password_field :password, placeholder: '********'
|
6
|
+
.admin-auth-actions= f.submit 'Login'
|
data/lib/admin_auth/version.rb
CHANGED
@@ -10,7 +10,7 @@ describe AdminAuth::Engine do
|
|
10
10
|
it { expect(subject.config.autoload_paths).to include "#{root_path}/sessions_controller.rb" }
|
11
11
|
end
|
12
12
|
|
13
|
-
describe 'autoload
|
13
|
+
describe 'autoload views' do
|
14
14
|
let(:root_path) { "#{subject.config.root}/app/views/admin" }
|
15
15
|
|
16
16
|
it { expect(subject.config.autoload_paths).to include "#{root_path}/admins/edit.haml" }
|
metadata
CHANGED
@@ -1,113 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: admin_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phillip Boksz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: haml
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 4.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 4.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '4'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: bundler
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.7'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ~>
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.7'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rake
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ~>
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '10.0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ~>
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '10.0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: pry
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ~>
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
47
|
+
version: 4.0.0
|
90
48
|
type: :development
|
91
49
|
prerelease: false
|
92
50
|
version_requirements: !ruby/object:Gem::Requirement
|
93
51
|
requirements:
|
94
|
-
- -
|
52
|
+
- - ">="
|
95
53
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
54
|
+
version: 4.0.0
|
97
55
|
- !ruby/object:Gem::Dependency
|
98
56
|
name: rspec
|
99
57
|
requirement: !ruby/object:Gem::Requirement
|
100
58
|
requirements:
|
101
|
-
- -
|
59
|
+
- - ">="
|
102
60
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
61
|
+
version: 3.0.0
|
104
62
|
type: :development
|
105
63
|
prerelease: false
|
106
64
|
version_requirements: !ruby/object:Gem::Requirement
|
107
65
|
requirements:
|
108
|
-
- -
|
66
|
+
- - ">="
|
109
67
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
68
|
+
version: 3.0.0
|
111
69
|
description: A gem for rails that helps with basic database authentication.
|
112
70
|
email:
|
113
71
|
- pboksz@gmail.com
|
@@ -115,9 +73,9 @@ executables: []
|
|
115
73
|
extensions: []
|
116
74
|
extra_rdoc_files: []
|
117
75
|
files:
|
118
|
-
- .gitignore
|
119
|
-
- .rspec
|
120
|
-
- .travis.yml
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".travis.yml"
|
121
79
|
- Gemfile
|
122
80
|
- LICENSE.txt
|
123
81
|
- README.md
|
@@ -156,17 +114,16 @@ require_paths:
|
|
156
114
|
- lib
|
157
115
|
required_ruby_version: !ruby/object:Gem::Requirement
|
158
116
|
requirements:
|
159
|
-
- -
|
117
|
+
- - ">="
|
160
118
|
- !ruby/object:Gem::Version
|
161
|
-
version:
|
119
|
+
version: 2.0.0
|
162
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
121
|
requirements:
|
164
|
-
- -
|
122
|
+
- - ">="
|
165
123
|
- !ruby/object:Gem::Version
|
166
124
|
version: '0'
|
167
125
|
requirements: []
|
168
|
-
|
169
|
-
rubygems_version: 2.4.5
|
126
|
+
rubygems_version: 3.0.8
|
170
127
|
signing_key:
|
171
128
|
specification_version: 4
|
172
129
|
summary: A gem for rails that helps with basic database authentication.
|