Forgot password
Forgot password is a special method of logging in.
The login starts off with the status
pending_login_verification
. Once you enter the code we emailed the user, the login status will move to
pending_password_reset
. Finally, once you enter the new password, the login should become active.
Arguments
status
The status of this login. Currently, this can only be set to logged_out
, and only if the current status is active.
verification_code
If the status is pending_login_verification
, this should be the emailed verification code. If the status is pending_two_factor_auth
, this should be the 2FA code or a recovery code.
new_password
The new password for this user, this can only be set if the current status is pending_password_reset
.
metadata
Object. You can store any other data you may have in this object.
Example Request
curl https://api.getrecognize.com/v1/forgot_password \
-u key_sec_demo_key: \
-d email="[email protected]"
var recognize = require("recognize-sdk")("key_sec_demo_key")
recognize.logins.forgot_password({
email: "[email protected]"
}).then(function(login) {
//Do something.
})
Example Response
{
"success": true,
"id": "lgn_jnhwg1990001di4n1zs9p5effnC59zRCm020928dc7e73547d29aacac0567dc9e34",
"object": "login",
"status": "pending_login_verification",
"method": "forgot_password",
"user": "usr_jn7bpsbc0032ob9zi1csq1h0hnlm401Ad3",
"device": {
"user_agent": "RecognizeNode/1.0.5",
"ip": "54.213.253.5",
"country": "US"
},
"metadata": {},
"created": 1540067532,
"url": "/v1/logins/lgn_jnhwg1990001di4n1zs9p5effnC59zRCm020928dc7e73547d29aacac0567dc9e34"
}