Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@stadline/react-mtcaptcha
Advanced tools
It is an unofficial library to use [MTCaptcha](https://www.mtcaptcha.com/) on a React application.
It is an unofficial library to use MTCaptcha on a React application.
As early as possible, call the initialize function.
// src/index.js
import React, { useEffect } from 'react';
import { initialize } from '@stadline/react-mtcaptcha';
function App(props) {
useEffect(() => {
initialize({
sitekey: 'MTPublic-oy2GGOZq8',
theme: 'neowhite',
lang: 'fr',
});
}, []);
return <Router />; // or whatever
}
You can use any config option, for example custom styles, except the callbacks and render modes which are handled by the lib.
Then you can use the Captcha
component in your forms
return <Captcha onVerified={state => alert(state.verifiedToken)} />;
A more detailed example:
// src/components/ContactForm.js
import React, { useState } from 'react';
import Captcha from '@stadline/react-mtcaptcha';
function ContactForm(props) {
const [formValue, setFormValue] = useState({
message: '',
verifiedToken: null,
});
const setFieldValue = (key, value) => setFormValue(fv => ({ ...fv, [key]: value }));
const onSubmit = event => {
event.preventDefault();
alert('submit');
};
return (
<form onSubmit={onSubmit}>
<label>
<div>Text:</div>
<textarea
value={formValue.message}
onChange={event => setFieldValue('message', event.target.value)}
/>
</label>
<Captcha onVerified={state => setFieldValue('verifiedToken', state.verifiedToken)} />
<button type="submit" disabled={formValue.message.length < 1 || !formValue.verifiedToken}>
Submit
</button>
</form>
);
}
FAQs
It is an unofficial library to use [MTCaptcha](https://www.mtcaptcha.com/) on a React application.
The npm package @stadline/react-mtcaptcha receives a total of 2 weekly downloads. As such, @stadline/react-mtcaptcha popularity was classified as not popular.
We found that @stadline/react-mtcaptcha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.