Created
June 17, 2021 11:31
-
-
Save Ref-Bit/6360413df9b0eecc0f9e5bb5d6d24e8e to your computer and use it in GitHub Desktop.
Convert authentication info (username, password) to Basic token in NodeJS
This file contains hidden or 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
const token = 'Basic ' + Buffer.from(`${username}:${password}`, 'utf8').toString('base64'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment