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

Auth client fails to unmarshal signup failure error #336

Closed
6 tasks done
stan-stately opened this issue Dec 21, 2023 · 2 comments
Closed
6 tasks done

Auth client fails to unmarshal signup failure error #336

stan-stately opened this issue Dec 21, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@stan-stately
Copy link

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of this SDK and the issue still persists.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

I'm creating a user programatically with the following code:

        auth0, err := authentication.New(context.Background(), "<redacted>")
	resp, err := auth0.Database.Signup(context.Background(), database.SignupRequest{
		ClientID:   "<redacted>"
		Email:      "<redacted>",
		Password:   "password",
		Connection: "Username-Password-Authentication",
	})

this returns the error: 400 Bad Request: failed to decode json error response payload: json: cannot unmarshal object into Go struct field authErrorWrapper.description of type string

Manually trying the operation via HTTP shows the real error:

Response body: {"name":"PasswordStrengthError","message":"Password is too weak","code":"invalid_password","description":{"rules":[{"message":"At least %d characters in length","format":[8],"code":"lengthAtLeast","verified":true},{"message":"Contain at least %d of the following %d types of characters:","code":"containsAtLeast","format":[3,4],"items":[{"message":"lower case letters (a-z)","code":"lowerCase","verified":true},{"message":"upper case letters (A-Z)","code":"upperCase","verified":false},{"message":"numbers (i.e. 0-9)","code":"numbers","verified":false},{"message":"special characters (e.g. !@#$%^&*)","code":"specialCharacters","verified":true}],"verified":false}],"verified":false},"policy":"* At least 8 characters in length\n* Contain at least 3 of the following 4 types of characters:\n * lower case letters (a-z)\n * upper case letters (A-Z)\n * numbers (i.e. 0-9)\n * special characters (e.g. !@#$%^&*)","statusCode":400}

I think this is a bug

Expectation

An error message that I can use to debug the issue

Reproduction

        auth0, err := authentication.New(context.Background(), "<redacted>")
	resp, err := auth0.Database.Signup(context.Background(), database.SignupRequest{
		ClientID:   "<redacted>"
		Email:      "<redacted>",
		Password:   "password",
		Connection: "Username-Password-Authentication",
	})

Auth0 Go SDK version

v1.4.0

@developerkunal
Copy link
Contributor

Hi @stan-stately ,

I wanted to let you know that we've successfully addressed the issue you raised. However, the fix hasn't been released just yet. I'm pleased to inform you that your PR has been merged #393 , and I want to express my gratitude for bringing it to our attention. Your contribution is greatly appreciated!

@developerkunal
Copy link
Contributor

Hi @stan-stately ,

Great news! The issue has been fixed in version 1.6.0. Please take a moment to review, and feel free to reach out if you encounter any further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants