Skip to content

Commit

Permalink
Fix gcaptcha in badges/iframe mode (rauchg#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
chromy authored and rauchg committed Dec 19, 2017
1 parent f3e3b3d commit 7962ff0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,12 @@ export default function slackin ({
let { name } = slack.org
let { active, total } = slack.users
if (!name) return res.send(404)
let dom = splash({ coc, path, name, org, channels, active, total, large, iframe: true })
let page = dom('html',
dom("script src=https://www.google.com/recaptcha/api.js"),
splash({ coc, path, name, org, channels, active, total, large, iframe: true, gcaptcha_sitekey })
)
res.type('html')
res.send(dom.toHTML())
res.send(page.toHTML())
})

app.get('/.well-known/acme-challenge/:id', (req, res) => {
Expand Down
7 changes: 7 additions & 0 deletions lib/splash.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,5 +342,12 @@ function style ({ logo, active, large, iframe } = {}){
})
}

if (iframe) {
css.add('.g-recaptcha', {
'transform': 'scale(0.76)',
'transform-origin': '0 0',
})
}

return css
}

0 comments on commit 7962ff0

Please sign in to comment.