Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateUserOptions metadata property type mismatch on v3 #758

Closed
6 tasks done
andreyleonardo opened this issue Oct 11, 2023 · 1 comment
Closed
6 tasks done

CreateUserOptions metadata property type mismatch on v3 #758

andreyleonardo opened this issue Oct 11, 2023 · 1 comment
Labels
bug This points to a verified bug in the code

Comments

@andreyleonardo
Copy link

Checklist

Description

Hi,

While upgrading from v2 to v3 I noticed that Typescript started to complain about my metadata in a createUser call being an object when this is expected to be a string.

When stringifying the object, the calls to Auth0 started to fail because Auth0 API expects an object.

The following error is returned from the Auth0 call:

{
  name:a0.response.invalid,
  message:unknown error,
  error:invalid user_metadata type (expected object),
  status:400
}

I think this is just a type mismatch for the metadata property in the CreateUserOptions because keeping it as an object (and suppressing the TS error) works as expected.

Reproduction

  1. Use the createUser method to call Auth0 signup
  2. Pass an object to the metadata property in that call
  3. TS will complain that the type for metadata is expected to be string | undefined
  4. Try to use JSON.stringify in your object to match the type
  5. Request to Auth0 will fail because it expects an object and not a string

Additional context

No response

react-native-auth0 version

3.0.1

React Native version

0.68.7

Expo version

No response

Platform

Android, iOS

Platform version(s)

N/A

@andreyleonardo andreyleonardo added the bug This points to a verified bug in the code label Oct 11, 2023
@poovamraj
Copy link
Contributor

poovamraj commented Nov 2, 2023

Thanks a lot for reporting this @andreyleonardo. We have created a PR to fix this - #789.

Please let us know your feedback. We will continue the conversation in the PR and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

2 participants