
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@berlinsms/react-twofa-component
Advanced tools
A Two Factor Authentication by BerlinSMS written in typescript- https://www.berlinsms.de/
@berlinsms/react-twofa-component is a TypeScript React Component to validate Phonenumbers or E-Mail Adresses using a Two Factor Authentification.
npm -i @berlinsms/react-twofa-component
The Mail and SMS verification are now located in the same Component. The Component will automaticly switch to the previously selected verificationmehtod (https://twofa.berlinsms.de/keygen).
import {TwoFA} from '@berlinsms/react-twofa-component';
// Minimal implementation:
<TwoFA
bsmsSitekey = {"your sitekey"}
/>
// Complete implementation:
<TwoFA
ref={twoFARef}
bsmsSitekey = {"your sitekey"}
onError = {TwoFAonError}
onVerify = {TwoFAonVerify}
onExpire = {TwoFAonExpire}
/>
To use this Component you have to configure your settings on https://twofa.berlinsms.de/keygen
By using the required bsmsSitekey Parameter your site will be validated and load all predefined settings. This Component will request your selected verification method and automaticly load the predefined configuration. Therefore it is not necessary to switch manualy between Mail-verification and SMS-verification. These settings also contain your captcha Type and Key.
The ref Parameter helps the user to keep track of the current object. By creating a reference additional informations can be gathers as for example the states. All of the state codes can be seen in the TwoFATypes.tsx file and are described below.
The onError function is called if an Error occures. This might be for example that component cant reach the API or the user has no more tries left. The function requires a error: string parameter, that describes the error.
The onVerify function is called when the user correctly entered the code and now your own webserver can validate the user request. The token (string) Parameter is required and is needed for the final verification. Optionally the inserted Two Factor Code can be requested: code?: string
The Language can be set by using the optional Parameter: bsmsLanguage. (bsmsLanguage?: "Eng" | "Ger";) This Parameter takes the values "Eng" or "Ger" (German). Default Language is German.
OnExpire is called when the time to fill out the component is run out. This function is still under development.
TwoFA Component
verificationType: verificationTypes; // gets the selected verification method (optin(sms) or optin(mail)
apiReady: boolean; // checks if the BerlinSMS API is reachable
isAddressValid: boolean; // Checks whether an SMS/Mail can be sent to the phonenumber
codeReady: boolean; // The user clicked on send Code -> to send a code the user has to solve the captcha, which will send the code
codeSend: boolean; // The code was send via SMS to the entered Phonenumber
codeVerified: boolean; // This will be true if the inserted code is correct (onVerify will be called)
errorOccured: boolean; // This will be true if an error occured (onError will be called)
errorMessage: string; // This gives additional error feedback and shows it in the component
// internal status codes
renderstatus: renderStatusTypes; // states for the state machine to render the content
captchaSitekey: string; // The current captchaSitekey
captchaToken: string; // Captchatoken when the captcha is solved
validationCode: string; // current userinput of the validation code
challengeToken: string; // challengeToken used for the BSMS TwoFA challenge
// internal variables
limitAttempts: number; // signals how many tries the user has left to solve the TwoFA Challenge
verificationAddress: string; // phonenumber/mailaddress the user has entered and send a code to
FAQs
A Two Factor Authentication by BerlinSMS written in typescript- https://www.berlinsms.de/
We found that @berlinsms/react-twofa-component demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.