Skip to content

Instantly share code, notes, and snippets.

@mattkelley
Last active September 19, 2017 19:59
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 mattkelley/b831e34581b4c83d7887829084e8c848 to your computer and use it in GitHub Desktop.
Save mattkelley/b831e34581b4c83d7887829084e8c848 to your computer and use it in GitHub Desktop.
Mock Admin Console API valid jwt example
// Create a multi-part form
const data = new FormData()
// Set number of seconds till JWT should expire
data.append('exp', '30')
// Fetch the JWT
fetch(`${window.location.origin}/home/jwt`, { method: 'POST', body: data })
.then(body => body.json())
.then(jwt => console.log(jwt))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment