Skip to content

Instantly share code, notes, and snippets.

@mrmartineau
Created May 16, 2018 15:48
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 mrmartineau/b9dd5e7a7a56c1acd45e41a12f08963a to your computer and use it in GitHub Desktop.
Save mrmartineau/b9dd5e7a7a56c1acd45e41a12f08963a to your computer and use it in GitHub Desktop.
setting an authorization header
const USERNAME = 'admin@foobar.com'
const TOKEN = 'hPPacTBSv7k0xAhAJrZjtmrmfhBj6rYd4UVfZvCO'
const authToken = btoa(
unescape(encodeURIComponent(`${USERNAME}:${TOKEN}`))
)
// authToken = 'YWRtaW5AZm9vYmFyLmNvbTpoUFBhY1RCU3Y3azB4QWhBSnJaanRtcm1maEJqNnJZZDRVVmZadkNP'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment