Skip to content

Commit

Permalink
Trying with random domain for captcha
Browse files Browse the repository at this point in the history
  • Loading branch information
macedonga committed Oct 30, 2024
1 parent 4192a02 commit 1a08600
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions components/ArkoseComponent.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import React, { useEffect, useRef, useState, forwardRef, useImperativeHandle } from "react";
import PropTypes from "prop-types";

function generateRandomString(length) {
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
let result = "";
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * characters.length));
}
return result;
}

const Arkose = forwardRef(({ publicKey, onCompleted, onError, ...props }, ref) => {
const iframeRef = useRef(null);
const [isButtonDisabled, setButtonDisabled] = useState(true);
Expand Down Expand Up @@ -31,7 +40,7 @@ const Arkose = forwardRef(({ publicKey, onCompleted, onError, ...props }, ref) =
setButtonDisabled(false);
break;
case "challenge-complete":
onCompleted(data.payload.sessionToken);
onCompleted(data.payload.sessionToken.split("|")[0]);
iframeRef.current.style.display = "none";
break;
case "challenge-show":
Expand Down Expand Up @@ -59,7 +68,7 @@ const Arkose = forwardRef(({ publicKey, onCompleted, onError, ...props }, ref) =
<iframe
id="arkoseFrame"
ref={iframeRef}
src={`${URL}`}
src={`https://${generateRandomString(10)}.beunblurred.co`}
style={{
display: "none",
}}
Expand Down

0 comments on commit 1a08600

Please sign in to comment.