Skip to content

Instantly share code, notes, and snippets.

@lancetw
Last active September 24, 2015 04:38
Show Gist options
  • Save lancetw/525ef09ea6a978cf6cf3 to your computer and use it in GitHub Desktop.
Save lancetw/525ef09ea6a978cf6cf3 to your computer and use it in GitHub Desktop.
export async function auth (form) {
return new Promise((resolve, reject) => {
request
.post('/api/v1/login')
.set('Accept', 'application/json')
.auth(form.email, form.password)
.end(function (err, res) {
if (!err && res.body) {
resolve(res.body)
} else {
reject(err)
}
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment