mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Initial commit
This commit is contained in:
21
app/controllers/passwords_controller.rb
Normal file
21
app/controllers/passwords_controller.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user