Sha256: 2f13b2896804dd5b59dde142b36614bd49741fb36a3d4e23802530c2e056a9fc

Contents?: true

Size: 684 Bytes

Versions: 6

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

module Overrides
  class RegistrationsController < DeviseJwtAuth::RegistrationsController
    OVERRIDE_PROOF = '(^^,)'.freeze

    def update
      if @resource
        if @resource.update(account_update_params)
          render json: {
            status: 'success',
            data:   @resource.as_json,
            override_proof: OVERRIDE_PROOF
          }
        else
          render json: {
            status: 'error',
            errors: @resource.errors
          }, status: 422
        end
      else
        render json: {
          status: 'error',
          errors: ['User not found.']
        }, status: 404
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
devise_jwt_auth-0.1.5 test/dummy/app/controllers/overrides/registrations_controller.rb
devise_jwt_auth-0.1.4 test/dummy/app/controllers/overrides/registrations_controller.rb
devise_jwt_auth-0.1.3 test/dummy/app/controllers/overrides/registrations_controller.rb
devise_jwt_auth-0.1.2 test/dummy/app/controllers/overrides/registrations_controller.rb
devise_jwt_auth-0.1.1 test/dummy/app/controllers/overrides/registrations_controller.rb
devise_jwt_auth-0.1.0 test/dummy/app/controllers/overrides/registrations_controller.rb