Sha256: 2daacc392cf09fc93805ed53ad7d6878ceead736af8d0fa3f951064616f72b19

Contents?: true

Size: 444 Bytes

Versions: 8

Compression:

Stored size: 444 Bytes

Contents

class PasswordsController < ApplicationController
  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(:password, :password_confirmation, :password_challenge).with_defaults(password_challenge: "")
    end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
authentication-zero-4.0.3 lib/generators/authentication/templates/controllers/api/passwords_controller.rb.tt
authentication-zero-4.0.2 lib/generators/authentication/templates/controllers/api/passwords_controller.rb.tt
authentication-zero-4.0.1 lib/generators/authentication/templates/controllers/api/passwords_controller.rb.tt
authentication-zero-4.0.0 lib/generators/authentication/templates/controllers/api/passwords_controller.rb.tt
authentication-zero-3.0.2 lib/generators/authentication/templates/controllers/api/passwords_controller.rb.tt
authentication-zero-3.0.1 lib/generators/authentication/templates/controllers/api/passwords_controller.rb.tt
authentication-zero-3.0.0 lib/generators/authentication/templates/controllers/api/passwords_controller.rb.tt
authentication-zero-3.0.0.alpha1 lib/generators/authentication/templates/controllers/api/passwords_controller.rb.tt