lib/generators/authentication/templates/controllers/api/password_resets_controller.rb.tt in authentication-zero-0.0.14 vs lib/generators/authentication/templates/controllers/api/password_resets_controller.rb.tt in authentication-zero-0.0.15
- old
+ new
@@ -1,8 +1,7 @@
class PasswordResetsController < ApplicationController
skip_before_action :authenticate
-
before_action :set_<%= singular_table_name %>, only: %i[ edit update ]
def edit
render json: { error: "Open this link in your device" }, status: :not_found
end
@@ -23,10 +22,10 @@
end
end
private
def set_<%= singular_table_name %>
- @<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:sid], purpose: "password_reset")
+ @<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:token], purpose: "password_reset")
rescue ActiveSupport::MessageVerifier::InvalidSignature
render json: { error: "Your token has expired, please request a new one" }, status: :bad_request
end
def <%= "#{singular_table_name}_params" %>