Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Commit

Permalink
Add github email to airtable prefill
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Oct 22, 2019
1 parent 53c4fe4 commit b65df9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ app.get('/', async (req, res) => {
})

const username = ghUser.data && ghUser.data.login
const email = ghUser.data && ghUser.data.email
if (username) {
console.log(
`GitHub tells me that this user is 'https://github.com/${username}'. I'll redirect them to the Airtable.`
)
res.redirect(302, `${formUrl}?prefill_GitHub%20Username=${username}`)
res.redirect(302, `${formUrl}?prefill_GitHub%20Username=${username}&prefil_GitHub%20Email=${email}`)
} else {
console.log(
"GitHub doesn't recognize this user. I'll just send them to the Airtable with nothing prefilled."
Expand Down

0 comments on commit b65df9d

Please sign in to comment.