import fetch from 'isomorphic-fetch'
import config_loader from '../config/config'

let config = config_loader.load()

// https://developers.google.com/recaptcha/docs/verify
export default async function recaptchaVerify(response, clientip) {
    let googleApi = 'https://www.google.com/recaptcha/api/siteverify'
    let uc = encodeUriComponent
    var res = await fetch(`${googleApi}?secret=${uc(config.recaptcha.secret)}&response=${uc(response)}&remoteip=${uc(clientip)}`)
    if (res.success) {
        return true
    }
    throw new Error("Bad captcha")
}

@@ -324,18 +324,18 @@
  encodeU
-ri
+RI
 Componen

Fix typo.