Sha256: 7fa2c85a72e90903afe841a3882a2ae511bc693c26a536492d426e60418d881e

Contents?: true

Size: 440 Bytes

Versions: 2

Compression:

Stored size: 440 Bytes

Contents

class Identity::EmailsController < ApplicationController
  <%- if options.sudoable? -%>
  before_action :require_sudo
  <%- end -%>
  before_action :set_user

  def update
    if @user.update(user_params)
      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

2 entries across 2 versions & 1 rubygems

Version Path
authentication-zero-2.15.2 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt
authentication-zero-2.15.1 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt