1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00
Maybe/app/controllers/passwords_controller.rb
Rob Zolkos 1cc9550c80 Lint files to rubocop omakase standards
root ➜ /workspace (fix-rubocop-issues) $ rubocop
Inspecting 54 files
......................................................

54 files inspected, no offenses detected
2024-02-02 16:07:29 +00:00

20 lines
490 B
Ruby

class PasswordsController < ApplicationController
before_action :authenticate_user!
def edit
end
def update
if current_user.update(password_params)
redirect_to root_path, notice: "Your password has been updated successfully."
else
render :edit, status: :unprocessable_entity
end
end
private
def password_params
params.require(:user).permit(:password, :password_confirmation, :password_challenge).with_defaults(password_challenge: "")
end
end