Create a password reset token for a user and reset the user’s password.
Get the details of an existing password reset token that can be used to reset a user’s password.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const passwordReset = await workos.userManagement.getPasswordReset( 'password_reset_01HYGDNK5G7FZ4YJFXYXPB5JRW', );
GET/user_management /password_reset /:idParameters Returns Creates a one-time token that can be used to reset a user’s password.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const passwordReset = await workos.userManagement.createPasswordReset({ email: 'marcelina@example.com', });
POST/user_management /password_resetReturns Sets a new password using the token query parameter from the link that the user received. Successfully resetting the password will verify a user’s email, if it hasn’t been verified yet.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const { user } = await workos.userManagement.resetPassword({ token: 'stpIJ48IFJt0HhSIqjf8eppe0', newPassword: 'i8uv6g34kd490s', });
POST/user_management /password_reset /confirmReturns