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

Error: SuperTokens core threw an error for a PUT request to path: '/recipe/user' with status code: 500 and message: Internal Error #514

Closed
sayhicoelho opened this issue Mar 15, 2023 · 9 comments

Comments

@sayhicoelho
Copy link

I can't change the user's password using the ThirdPartyEmailPassword recipe.

I'm trying to run this piece of code taken from the docs:

image

The response is:

image

Frontend code:

image

Backend code:

image

Docs:
https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/change-password#step-2-validate-and-update-the-users-password

@rishabhpoddar
Copy link
Member

Hi.

  • What are the error logs on the core when you call this API?
  • Did you manually delete entries in the emailpassword_users or the all_auth_users table?

@sayhicoelho
Copy link
Author

@rishabhpoddar Hi. The only logs I have are the ones I uploaded in the issue. I don't know how to get logs you're requesting. Also, I haven't manually deleted any entries in the database.

@rishabhpoddar
Copy link
Member

You can get the logs by seeing the docker logs output of the core process. If you are not using docker for the core, then you can find it in the logs folder in the installation directory.

Finally, if you are using our managed service, then you can join our discord and message me (my handle is rp) your email and i can have a look.

@rishabhpoddar
Copy link
Member

We have identified the issue - we will release a new version of the core shortly.

@rishabhpoddar
Copy link
Member

This has been fixed in core version >= 4.4.2

If you are using docker, then the docker tag is 4.4, be sure to delete the older docker image and pull it again.

@sayhicoelho
Copy link
Author

@rishabhpoddar I'm using the managed service. How can I use the updated version of supertokens-core? I tried to run the password change but got the same error.

@rishabhpoddar
Copy link
Member

Should be working fine now @sayhicoelho - please try again.

@sayhicoelho
Copy link
Author

sayhicoelho commented Mar 17, 2023

Thanks @rishabhpoddar ! It worked, but the response is empty.

image

The else if (response.data.status === "OK") is never reached.

image

Also, the password strength validation is not working. I can easily change my password to something like secret.

@rishabhpoddar
Copy link
Member

So the frontend should call your backend API to change the password. The backend API would then call the core. Therefore, the frontend should check for the response based on what your backend API sends. Based on the screenshot above, you do res.end() on the backend after succesful change in password, you do not send a JSON response - therefore the frontend won't get it.

About the password strength, that's a check that's done on the backend sdk level in the APIs that we expose via the middleware. So since you are making your own API here, you need to check the password strength yourself before calling the updateEmailOrPassword function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants