lib/generators/authentication/templates/controllers/api/password_resets_controller.rb.tt in authentication-zero-2.2.10 vs lib/generators/authentication/templates/controllers/api/password_resets_controller.rb.tt in authentication-zero-2.3.0
- old
+ new
@@ -2,11 +2,11 @@
skip_before_action :authenticate
before_action :set_<%= singular_table_name %>, only: :update
def create
- if @<%= singular_table_name %> = <%= class_name %>.find_by(email: params[:email], verified: true)
- IdentityMailer.with(<%= singular_table_name %>: @<%= singular_table_name %>).password_reset_provision.deliver_later
+ if <%= singular_table_name %> = <%= class_name %>.find_by(email: params[:email], verified: true)
+ IdentityMailer.with(<%= singular_table_name %>: <%= singular_table_name %>).password_reset_provision.deliver_later
else
render json: { error: "You can't reset your password until you verify your email" }, status: :not_found
end
end