Skip to content

Instantly share code, notes, and snippets.

@thejohnfreeman
Created January 7, 2019 21:54
Show Gist options
  • Save thejohnfreeman/104a4a5fea757070e8ead1d0c520d325 to your computer and use it in GitHub Desktop.
Save thejohnfreeman/104a4a5fea757070e8ead1d0c520d325 to your computer and use it in GitHub Desktop.
async function getFullName(username, password) {
let token
try {
token = await logIn(username, password);
} catch (error) {
console.error('wrong username or password')
return
}
const user = await getUser(token)
return user.fullName
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment