Last active
September 24, 2015 04:38
-
-
Save lancetw/525ef09ea6a978cf6cf3 to your computer and use it in GitHub Desktop.
This file contains 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
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