authentication-zero 2.11.0 → 2.11.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/authentication_zero/version.rb +1 -1
- data/lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt +1 -1
- data/lib/generators/authentication/templates/controllers/html/sessions/sudos_controller.rb.tt +1 -1
- data/lib/generators/authentication/templates/models/session.rb.tt +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26344aaefae4e99ea2048950089e5927a62d473f85d94596456006d6edbbc8ee
|
4
|
+
data.tar.gz: eebff7007c4754244993ac76b022081ccbd0201dac5cd1611ec84f8845e7a5d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ccd04a438745b60d071c9203c5e36588b01333a17e37a5ee1067c7007824d52fb2a3be0c5e4864868c393f9dec04e2284487651f7d7b0f908c238dcbf4a9dd2
|
7
|
+
data.tar.gz: 51b53ff133cdf9a69e42f29cadd19127646d6c98a6d476c1565c5e6151708b57f4076e1f19af4f4335b8bd6a08ac90b9328b6fe393f85d702dd7d415621a9c8a
|
data/Gemfile.lock
CHANGED
data/lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt
CHANGED
@@ -3,7 +3,7 @@ class Sessions::SudosController < ApplicationController
|
|
3
3
|
session = Current.session
|
4
4
|
|
5
5
|
if session.<%= singular_table_name %>.authenticate(params[:password])
|
6
|
-
session.sudo.mark
|
6
|
+
session.sudo.mark
|
7
7
|
else
|
8
8
|
render json: { error: "The password you entered is incorrect" }, status: :bad_request
|
9
9
|
end
|
data/lib/generators/authentication/templates/controllers/html/sessions/sudos_controller.rb.tt
CHANGED
@@ -10,7 +10,7 @@ class Sessions::SudosController < ApplicationController
|
|
10
10
|
<%- else -%>
|
11
11
|
if session.<%= singular_table_name %>.authenticate(params[:password])
|
12
12
|
<%- end -%>
|
13
|
-
session.sudo.mark
|
13
|
+
session.sudo.mark; redirect_to(params[:proceed_to_url])
|
14
14
|
else
|
15
15
|
redirect_to new_sessions_sudo_path(proceed_to_url: params[:proceed_to_url]), alert: "The password you entered is incorrect"
|
16
16
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class Session < ApplicationRecord
|
2
2
|
belongs_to :<%= singular_table_name %>
|
3
3
|
<%- if options.sudoable? %>
|
4
|
-
kredis_flag :sudo
|
4
|
+
kredis_flag :sudo, expires_in: 30.minutes
|
5
5
|
<%- end -%>
|
6
6
|
|
7
7
|
before_create do
|
@@ -10,7 +10,7 @@ class Session < ApplicationRecord
|
|
10
10
|
end
|
11
11
|
<%- if options.sudoable? %>
|
12
12
|
after_create_commit do
|
13
|
-
self.sudo.mark
|
13
|
+
self.sudo.mark
|
14
14
|
end
|
15
15
|
<%- end -%>
|
16
16
|
|