mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
root ➜ /workspace (fix-rubocop-issues) $ rubocop Inspecting 54 files ...................................................... 54 files inspected, no offenses detected
20 lines
490 B
Ruby
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
|