Git Product home page Git Product logo

fusionauth-ruby-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fusionauth-ruby-client's Issues

patch_user method in /lib/fusionauth/fusionauth_client.rb not working

The user API declares that username or email must be declared in request body - if they are included for identification then the user cannot update them?

Assuming the request body is the second parameter sent in the formatted JSON as specified in the User API an example request that I use that results in a 200 but no update to the user is:

{\"firstName\":\"Bertie\",\"lastName\":\"G\",\"email\":\"[email protected]\"}

patch_user method :

returns success response with status 200 but none of the information is updated, user information in user table in database remains unchanged.

image

Undefined method with bang operator; fix in readme documentation

Methods are not defined in repo with a bang, if you follow the documentation

id = SecureRandom.uuid
**client.register!(id, {**
    :user => {
        :firstName => 'Ruby',
        :lastName => 'Client',
        :email => '[email protected]',
        :password => 'password'
    },
    :registration => {
        :applicationId => application_id,
        :data => {
            :foo => 'bar'
        },
        :preferredLanguages => %w(en fr),
        :roles => %w(user)
    }
})

# Authenticate the user
**response = client.login!({**
    :loginId => '[email protected]',
    :password => 'password',
    :applicationId => application_id
})
user = response.user

Removing the bang operator allows proper function of the methods

reactivate_user incorrectly sets the content-type for the FusionAuth User API

When attempting to re-activate a user, the library returns the following error:

#<OpenStruct fieldErrors=#<OpenStruct>, generalErrors=[#<OpenStruct code="[InvalidContentType]", message="Invalid [Content-Type] HTTP request header value of [application/x-www-form-urlencoded]. Supported values for this request include [application/json].">]>

version 1.42.0

Steps to recreate:

  1. Follow this guide to getting setup: https://fusionauth.io/docs/v1/tech/client-libraries/ruby
  2. Call deactivate, which should work correctly
  3. Call reactivate, which should result in the following error above.

Code snippet:

require 'fusionauth/fusionauth_client'

# Construct the FusionAuth Client
client = FusionAuth::FusionAuthClient.new(
    'xxxxxxxxxxx', 
    'http://localhost:9011'
)

# # Deactivate a user
user_id = '123'
response = client.deactivate_user(user_id)

# Reactivate a user
response = client.reactivate_user(user_id)`

Solution:

FusionAuth should correctly handle the Content-Type for this method so no error is returned, perhaps defaulting to 'application/json`.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.