Skip to content

Instantly share code, notes, and snippets.

@joshuarossi
Created January 16, 2019 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuarossi/276a2f6b382a975783a13b3ee83ebff2 to your computer and use it in GitHub Desktop.
Save joshuarossi/276a2f6b382a975783a13b3ee83ebff2 to your computer and use it in GitHub Desktop.
How to reset password
// 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