nyauth 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 +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +5 -3
- data/app/controllers/nyauth/passwords_controller.rb +3 -0
- data/app/controllers/nyauth/sessions_controller.rb +3 -1
- data/app/helpers/nyauth/application_helper.rb +1 -1
- data/lib/nyauth/version.rb +1 -1
- data/spec/dummy/app/controllers/application_controller.rb +1 -0
- data/spec/dummy/app/views/layouts/application.html.erb +6 -1
- data/spec/dummy/config/initializers/nyauth.rb +3 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +3661 -0
- data/spec/dummy/log/test.log +16319 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/00R4IbuMWUgW0TswtkCnDqB8MUJqvz76FgkmbrLPTd8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/1-v7tFLPkD6uyCpAKjAKORwPg5YalyY-SYwjNGTiHQo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/122B1KZyQmgyJoX7uc4JINcUDUmcMHJsbf5JopBIpSg.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/2W23wCoDaNvkpc-htXrPJ_4wwRXsCB8sDUi-vlecXRY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8UAh9fJot2eROIl2PFflmIp2Q0G3oNNzBxCYx6AWaTw.cache +3 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8Ze9kDXrEQxOBazUvSE0NM5zLGZnHFsDskzK_P47vk4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Ald0qisxC6krU6CCGUtsVQJwZ786HWf2a4VJnhi2Lrw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Bx8MbffT9WQGgl0DcTM5n11UlQabeTzIyqKGm2snGus.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/CjFGeOmtoOvDUwEi78Mx3PtuchpMqlfecazo-n8RsAQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/DK6c5xJ8kSeXSqJlndPmMohu6AMbxDTYw3amSuVkoTs.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/E16A8LE9OYp6k-WBc2Egdmn6XL_-ipcmDOYBOfBITqs.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EGILbSm92CBXW0Z6Mp6o2YygxS4b8Hhd2CW8igzKuRM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/FIPwj786RByADaWtmUkp2eeWQvQ_QmX1ER1sGGOKgqo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Fo9EHolUACmT7eKdJVmIzktbVgFRBZQkcCGHFfpD7u0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KiPxsMrAEr8OMX4H_Q8MSOgJ0PuFTQf2yX0S4kZsDVs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Tpj_x0CkqGAEMDgH-JGBkdkajznkLbbiVVZOxEqURxU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZM48tpiRiDxrKqKUvohWJfOeqwp5RsXgtKY84fW-qEE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZcwAlVnn77peLsFoZbCh7F7wpmxPhsehRs1frol6gfU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/h1z_izpQoHamMnv_RoNWN6gT2x3tY11ndWa7uVWkiaE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/k-V4Qz1zxawVTQoo00igdXRPgv4xOiV8fQsQtj8uDhA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/lANr4VX8LDWQ3kMj0yoqyqiwK3SEqtIXkA-22639ZQQ.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/mKfHoait9-j98PxObraQnsOWSk7xeFfrgppKbFtsUP0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/s0L4Qc1LxOsV_VIoN33m851q4i5lQVM1ygIhke4UJhM.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/sjZSTu90VegaTEOBnEbgI9A0_THfWp-_QVzTR7p7m_k.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/y7TMQhIN-uRk0HFOYLmEtgTZdktzieFoy6OGzULuesI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ysMIP1GiNEslwSMFx4V6kVDb4UFG1mgq0U7Pjh2AIzY.cache +1 -0
- data/spec/dummy/tmp/capybara/capybara-201507112215421960933759.html +1 -0
- data/spec/dummy/tmp/capybara/capybara-20150711221603434494315.html +1 -0
- data/spec/dummy/tmp/capybara/capybara-201507112216361494719582.html +21 -0
- data/spec/dummy/tmp/capybara/capybara-201507112233431710633186.html +20 -0
- metadata +64 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ad3b4a881cc5ba9efe2e7230467642068906b52
|
4
|
+
data.tar.gz: 50d8fdee969e3210e9a54217bcc0b146bec4fb1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da27181102d3320122ca94bcc6b9f8bd1864675b8d49f0e697a93fd01a4d53dc1f37878441ba96bdb4149e4bb81e7702664726d998929600f91a9e0ac386625f
|
7
|
+
data.tar.gz: 3dd04d685f016d32c57ce1d80b6ac9e5058f6e178be9227c03a8ba085928c8a5f54367d476f0fbaad3d70e24bc13ca96fc7a5558a2b7eb7d3749ef52789624a0
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Simple & modualbe authentication gem
|
4
4
|
|
5
|
+
[CHANGE LOG](https://github.com/ppworks/nyauth/blob/master/CHANGELOG.md)
|
6
|
+
|
5
7
|
### application_controller.rb
|
6
8
|
|
7
9
|
```ruby
|
@@ -94,7 +96,7 @@ new_reset_password_request GET /reset_password_requests/new(.:format)
|
|
94
96
|
PUT /reset_passwords/:reset_password_key(.:format) nyauth/reset_passwords#update
|
95
97
|
```
|
96
98
|
|
97
|
-
```
|
99
|
+
```ruby
|
98
100
|
new_session_path_for(:user) # /session/new
|
99
101
|
new_session_path_for(:admin) # /admin/session/new
|
100
102
|
```
|
@@ -127,7 +129,7 @@ export NYAUTH_ENCRYPTION_SECRET=`bundle exec rake secret`
|
|
127
129
|
|
128
130
|
Or edit `config/initializers/nyauth.rb`
|
129
131
|
|
130
|
-
```
|
132
|
+
```ruby
|
131
133
|
nyauth.configure do |config|
|
132
134
|
config.encryption_secret = ENV['NYAUTH_ENCRYPTION_SECRET'] || ENV['SECRET_KEY_BASE']
|
133
135
|
config.confirmation_expire_limit = 1.hour
|
@@ -154,7 +156,7 @@ end
|
|
154
156
|
|
155
157
|
I18n
|
156
158
|
|
157
|
-
```
|
159
|
+
```yaml
|
158
160
|
ja:
|
159
161
|
flash:
|
160
162
|
nyauth:
|
@@ -2,6 +2,9 @@ module Nyauth
|
|
2
2
|
class PasswordsController < ApplicationController
|
3
3
|
include Nyauth::ApplicationConcern
|
4
4
|
include Nyauth::ClientConcern
|
5
|
+
include Nyauth::SessionConcern
|
6
|
+
before_action -> { require_authentication! as: client_name }
|
7
|
+
|
5
8
|
respond_to :html, :json
|
6
9
|
before_action :set_client
|
7
10
|
|
@@ -2,6 +2,8 @@ module Nyauth
|
|
2
2
|
class SessionsController < ApplicationController
|
3
3
|
include Nyauth::ApplicationConcern
|
4
4
|
include Nyauth::ClientConcern
|
5
|
+
include Nyauth::SessionConcern
|
6
|
+
before_action -> { require_authentication! as: client_name }
|
5
7
|
allow_everyone only: [:new, :create]
|
6
8
|
respond_to :html, :json
|
7
9
|
before_action :set_session_service
|
@@ -16,7 +18,7 @@ module Nyauth
|
|
16
18
|
|
17
19
|
def destroy
|
18
20
|
sign_out
|
19
|
-
respond_with @session_service, location: Nyauth.configuration.redirect_path_after_sign_out.call(client_name) ||
|
21
|
+
respond_with @session_service, location: Nyauth.configuration.redirect_path_after_sign_out.call(client_name) || new_session_path_for(client_name)
|
20
22
|
end
|
21
23
|
|
22
24
|
private
|
data/lib/nyauth/version.rb
CHANGED
@@ -16,6 +16,11 @@
|
|
16
16
|
<%= flash[:alert] %>
|
17
17
|
<% end %>
|
18
18
|
<%= link_to "URL helper on application", posts_path %>
|
19
|
-
|
19
|
+
<% if signed_in?(as: :user) %>
|
20
|
+
<%= link_to 'Sign out', session_path_for(:user), class: 'pure-menu-link', method: :delete %>
|
21
|
+
<% end %>
|
22
|
+
<% if signed_in?(as: :admin) %>
|
23
|
+
<%= link_to 'Sign out', session_path_for(:admin), class: 'pure-menu-link', method: :delete %>
|
24
|
+
<% end %>
|
20
25
|
</body>
|
21
26
|
</html>
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|