Sha256: 1e64e341089f936c8b7712ec022239d366391ad16088ebb682d401438a395501
Contents?: true
Size: 875 Bytes
Versions: 13
Compression:
Stored size: 875 Bytes
Contents
require_dependency "egov_utils/application_controller" module EgovUtils class PasswordsController < ApplicationController skip_before_action :check_password_change def edit @user = current_user end def update @user = current_user if @user.password_change_possible? && @user.password_check?(params[:password_change][:current_password]) @user.attributes = password_change_params @user.must_change_password = false end if @user.save flash[:notice] = t(:notice_password_changed) redirect_to main_app.root_path else flash[:warning] = t(:warning_password_not_changed) redirect_to edit_password_path(@user) end end private def password_change_params params.require(:password_change).permit(:password, :password_confirmation) end end end
Version data entries
13 entries across 13 versions & 1 rubygems