Sha256: 092d4a268c372c0b621369ae4228fc6d2bc523237ed92c8988770716d56b9775
Contents?: true
Size: 692 Bytes
Versions: 10
Compression:
Stored size: 692 Bytes
Contents
class Identity::EmailsController < ApplicationController <%- if options.sudoable? -%> before_action :require_sudo <%- end -%> before_action :set_user def update <%- unless options.sudoable? -%> if !@user.authenticate(params[:current_password]) render json: { error: "The password you entered is incorrect" }, status: :bad_request elsif @user.update(user_params) <%- else -%> if @user.update(user_params) <%- end -%> render json: @user else render json: @user.errors, status: :unprocessable_entity end end private def set_user @user = Current.user end def user_params params.permit(:email) end end
Version data entries
10 entries across 10 versions & 1 rubygems