mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
20 lines
589 B
Ruby
20 lines
589 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Devise controller used for the "forgotten password" feature
|
|
class PasswordsController < Devise::PasswordsController
|
|
# POST /users/password.json
|
|
def create
|
|
self.resource = resource_class.send_reset_password_instructions(resource_params)
|
|
yield resource if block_given?
|
|
|
|
if successfully_sent?(resource)
|
|
respond_with({}, location: after_sending_reset_password_instructions_path_for(resource_name))
|
|
end
|
|
end
|
|
|
|
# POST /password/verify
|
|
def verify
|
|
current_user.valid_password?(params[:password]) ? head(200) : head(404)
|
|
end
|
|
end
|