I have an issue with implementing ReCaptcha v2 in my Elm code as used in Rails. I want to send the token as part of the request to the API where validations will take place. The issue is I can’t seem to find a way of getting the token to my elm code.
below are the custom fields of the form
viewFields =
[ Fields.Submission
{ errors = errorMessagesForKeyLabel state.error "display_text" ""
, label = animatedPrompt typeSpecificContent state
, labelPlacement = typeSpecificContent.inputLabelPlacement
, charactersRemainingText = getCharactersRemainingText typeSpecificContent state
, value = state.questionText
, message = UpdateQuestion
}
, Fields.SectionHeaderGroup
{ header = typeSpecificContent.contactInfoSectionHeader
, subheader = typeSpecificContent.contactInfoSectionSubheader
}
, Fields.Text
{ errors = errorMessagesForKeyLabel state.error "name" typeSpecificContent.formNameLabel
, label = typeSpecificContent.formNameLabel
, labelPlacement = typeSpecificContent.inputLabelPlacement
, value = state.askerName
, message = UpdateName
}
, emailField
, Fields.Recaptcha { id = "recaptcha-container" }
]
For the recaptcha we just define that empty div with that id and use google recaptcha api onload to display the recaptcha.
When recaptcha is verified how can i get the token to the Elm code