Created
January 16, 2019 21:09
-
-
Save joshuarossi/276a2f6b382a975783a13b3ee83ebff2 to your computer and use it in GitHub Desktop.
How to reset password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here is location the link takes you to | |
const rawParams = "?resetPass=true&verifycode=71849a34-d60e-4c29-9f77-2cf008756ab3&d1=aHR0cHM6Ly9hcGlsYXVyZWF0ZWRjLmFscGhhcG9pbnQuY29tOjg0NDMvQVAv&UserId=6" | |
const queryParams = parse(search); // This step may vary but you are just getting some query params | |
const {UserId, verifycode, d1} = queryParams; // Get these specific query params | |
// Put them together into the payload of your request | |
const params = { | |
PendingCode: verifycode, | |
Password: "Your New Password", | |
UserId | |
} | |
const url = atob(d1); // decode the base64 string to get the URL | |
// | |
const response = await fetch(`${url}ResetPassword2`, { | |
method: 'POST', | |
body: JSON.stringify(params), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment