Last active
October 5, 2022 06:16
-
-
Save cp-sumi-k/1d53410f0ee7f75e6341eb6c4f7f02a8 to your computer and use it in GitHub Desktop.
https://blog.canopas.com/integrate-google-recaptcha-enterprise-using-vue-js-and-golang-60a9335e80ac - recaptcha-client
This file contains hidden or 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
ctx := context.Background() | |
/** convert base64 formetted JSON to bytearray */ | |
credBytes, err := b64.StdEncoding.DecodeString(os.Getenv("JSON_BASE64")) | |
if err != nil { | |
return false, err | |
} | |
/** create reCaptcha client with JSON bytearray */ | |
client, err := recaptcha.NewClient(ctx, option.WithCredentialsJSON(credBytes)) | |
if err != nil { | |
return false, err | |
} | |
/** close client when it's done */ | |
defer client.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment