fix: add frontend validation for captcha in organization settings
This commit is contained in:
@@ -138,11 +138,24 @@ export default function OrganizationSettings() {
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
if (!inviteEmail) return
|
if (!inviteEmail) return
|
||||||
|
|
||||||
|
if (!captchaToken) {
|
||||||
|
toast.error('Please complete the security check')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
setIsInviting(true)
|
setIsInviting(true)
|
||||||
try {
|
try {
|
||||||
await sendInvitation(currentOrgId, inviteEmail, inviteRole)
|
await sendInvitation(currentOrgId, inviteEmail, inviteRole, {
|
||||||
|
captcha_id: captchaId,
|
||||||
|
captcha_solution: captchaSolution,
|
||||||
|
captcha_token: captchaToken
|
||||||
|
})
|
||||||
toast.success(`Invitation sent to ${inviteEmail}`)
|
toast.success(`Invitation sent to ${inviteEmail}`)
|
||||||
setInviteEmail('')
|
setInviteEmail('')
|
||||||
|
// Reset captcha
|
||||||
|
setCaptchaId('')
|
||||||
|
setCaptchaSolution('')
|
||||||
|
setCaptchaToken('')
|
||||||
loadMembers() // Refresh list
|
loadMembers() // Refresh list
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
toast.error(error.message || 'Failed to send invitation')
|
toast.error(error.message || 'Failed to send invitation')
|
||||||
|
|||||||
Reference in New Issue
Block a user