Skip to content

Commit

Permalink
turnstile logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cankurttekin committed Nov 12, 2024
1 parent b7a806f commit a8ecdcf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions frontend/src/components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ const Login = () => {
const { login } = useContext(AuthContext);
const [turnstileToken, setTurnstileToken] = useState(null);

const handleTurnstileChange = (token) => {
setTurnstileToken(token);
const handleTurnstileChange = (turnstileToken) => {
setTurnstileToken(turnstileToken);
console.log('Turnstile token:', turnstileToken);
};

const handleSubmit = async (e) => {
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/TurnstileWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Turnstile from 'react-turnstile';
import {REACT_APP_TURNSTILE_SITE_KEY} from "../config";

const TurnstileWidget = ({ onChange }) => {
const [token, setToken] = useState(null);
const [turnstileToken, setTurnstileToken] = useState(null);

const handleTurnstileChange = (value) => {
setToken(value);
const handleTurnstileChange = (turnstileToken) => {
setTurnstileToken(turnstileToken);
if (onChange) {
onChange(value); // Pass token back to parent component
onChange(turnstileToken); // Pass token back to parent component
}
};

Expand Down

0 comments on commit a8ecdcf

Please sign in to comment.