Skip to content

Instantly share code, notes, and snippets.

@nosvalds
Created October 18, 2020 13:24
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 nosvalds/43ddb31ac39ee704615491e5c5b01dc6 to your computer and use it in GitHub Desktop.
Save nosvalds/43ddb31ac39ee704615491e5c5b01dc6 to your computer and use it in GitHub Desktop.
Function to create a password reset token
/**
* Create password reset token using inbuilt crypto
*/
const createResetToken = () => {
return require('crypto').randomBytes(32).toString('hex')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment