lib/generators/authentication/templates/controllers/html/sessions/sudos_controller.rb.tt in authentication-zero-2.10.0 vs lib/generators/authentication/templates/controllers/html/sessions/sudos_controller.rb.tt in authentication-zero-2.11.0
- old
+ new
@@ -8,10 +8,10 @@
<%- if omniauthable? -%>
if session.<%= singular_table_name %>.authenticate(params[:password]) || session.<%= singular_table_name %>.provider
<%- else -%>
if session.<%= singular_table_name %>.authenticate(params[:password])
<%- end -%>
- session.update!(sudo_at: Time.current); redirect_to(params[:proceed_to_url])
+ session.sudo.mark(expires_in: 30.minutes); redirect_to(params[:proceed_to_url])
else
redirect_to new_sessions_sudo_path(proceed_to_url: params[:proceed_to_url]), alert: "The password you entered is incorrect"
end
end
end