Production Build Working
This commit is contained in:
@@ -1,25 +1,30 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Users::PasswordsController < Devise::PasswordsController
|
||||
# GET /resource/password/new
|
||||
# def new
|
||||
# super
|
||||
# end
|
||||
# POST /users/password
|
||||
def create
|
||||
self.resource = resource_class.send_reset_password_instructions(resource_params)
|
||||
yield resource if block_given?
|
||||
|
||||
# POST /resource/password
|
||||
# def create
|
||||
# super
|
||||
# end
|
||||
if successfully_sent?(resource)
|
||||
render json: { message: "Password reset instructions sent successfully." }, status: :ok
|
||||
else
|
||||
render json: { errors: resource.errors.full_messages }, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# GET /resource/password/edit?reset_password_token=abcdef
|
||||
# def edit
|
||||
# super
|
||||
# end
|
||||
# PUT /users/password
|
||||
def update
|
||||
self.resource = resource_class.reset_password_by_token(resource_params)
|
||||
yield resource if block_given?
|
||||
|
||||
# PUT /resource/password
|
||||
# def update
|
||||
# super
|
||||
# end
|
||||
if resource.errors.empty?
|
||||
resource.unlock_access! if unlockable?(resource)
|
||||
render json: { message: "Password updated successfully." }, status: :ok
|
||||
else
|
||||
render json: { errors: resource.errors.full_messages }, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# protected
|
||||
|
||||
|
||||
Reference in New Issue
Block a user