
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
oneclickauth
Advanced tools
An easy-to-use React npm package for seamless SignIn and SignUp functionality with customizable themes and OAuth integration.
OneClickAuth is a customizable and easy-to-integrate Sign In and Sign Up React component package for seamless user authentication. This package allows you to easily implement authentication flows into your React app, with OAuth support for third-party providers.
To install OneClickAuth into your React project, run the following command:
npm install oneclickauth
import { SignUp, SignIn } from 'oneclickauth';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/sign-up" element={<SignUp />} />
<Route path="/sign-in" element={<SignIn/>} />
</Routes>
</BrowserRouter>
);
}
export default App;
// Simple onSubmit function
const handleFormSubmit = (formData) => {
console.log("Form submitted:", formData);
return { success: true, message: "Form submitted successfully!" };
};
// Usage in SignUp component
function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/sign-up" element={
<SignUp
onSubmit={handleFormSubmit}
/>} />
<Route path="/sign-in" element={<SignIn/>} />
</Routes>
</BrowserRouter>
);
}
import { useNavigate } from "react-router-dom";
// create a function named SignInWrapper
const SignInWrapper = () => {
const navigate = useNavigate();
// Handles form submision data
const handleSignIn = async (formData) => {
try {
// add your backend endpoints
const response = await fetch("Your_Endpoints", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(formData),
});
const data = await response.json();
if (!response.ok || data.success === false) {
return { success: false, message: data.message || "An error occurred" };
}
// after successful signin redirect to '/' you can add your desired path
navigate('/');
return { success: true };
} catch (error) {
return { success: false, message: "Network error" };
}
};
return (
<SignIn
onSubmit={handleSignIn}
placeholders={{
email: "Enter your email",
password: "Enter your password",
}}
buttonText="Sign In"
className="custom-signin"
OAuthComponent={OAuth}
/>
);
};
// pass SignInWrapper as prop
function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/sign-in" element={ <SignInWrapper/> } />
</Routes>
</BrowserRouter>
);
}
This package is for the frontend only. If you need backend support for authentication, you can use the backend package by following this link: https://www.npmjs.com/package/oneclickauth-backend
| Prop Name | Type | Description | Default |
|---|---|---|---|
onSubmit | function | Function to handle form submission. | undefined |
buttonText | string | Text to display on the submit button. | "Sign Up" |
OAuthComponent | Component | Custom OAuth component for third-party login support. | undefined |
placeholders | Object | Placeholder text for username, email, password inputs. | { username: "Your username", email: "Your email", password: "Your password" } |
theme | string | Theme of the component, either "light" or "dark". | "light" |
containerStyle | Object | Custom style object for the container. | {} |
headerStyle | Object | Custom style object for the header. | {} |
inputStyle | Object | Custom style object for input fields. | {} |
buttonStyle | Object | Custom style object for the submit button. | {} |
footerStyle | Object | Custom style object for the footer. | {} |
errorStyle | Object | Custom style object for error messages. | {} |
| Prop Name | Type | Description | Default |
|---|---|---|---|
onSubmit | function | Function to handle form submission. | undefined |
buttonText | string | Text to display on the submit button. | "Sign In" |
OAuthComponent | Component | Custom OAuth component for third-party login support. | undefined |
placeholders | Object | Placeholder text for email, password inputs. | { email: "Enter your email", password: "Enter your password" } |
theme | string | Theme of the component, either "light" or "dark". | "light" |
containerStyle | Object | Custom style object for the container. | {} |
headerStyle | Object | Custom style object for the header. | {} |
inputStyle | Object | Custom style object for input fields. | {} |
buttonStyle | Object | Custom style object for the submit button. | {} |
footerStyle | Object | Custom style object for the footer. | {} |
errorStyle | Object | Custom style object for error messages. | {} |
<SignUp
containerStyle={{ backgroundColor: '#f0f0f0' }}
headerStyle={{ color: '#333' }}
inputStyle={{ color: '#000' }}
buttonStyle={{ background: 'linear-gradient(to right, #ff7e5f, #feb47b)' }}
footerStyle={{ color: '#000' }}
errorStyle={{ color: 'red' }}
/>
You can also create a CSS file and use these class names to add custom styles.
The SignIn component uses the following CSS class names:
| Class Name | Description |
|---|---|
signin-container | The container for the entire sign-in component. |
signin-header | The header element within the sign-in form. |
signin-form | The form element for sign-in inputs and button. |
signin-input | The input fields for email and password. |
signin-button | The button used to submit the form. |
signin-footer | The footer section of the sign-in component. |
signin-footer-text | The text within the footer. |
signup-signin-link | The link to navigate to the sign-up page. |
signin-error | The error message display area. |
signin-success | The success message display area. |
Make sure to define these classes in your CSS file (Custom.css) to style the SignIn component appropriately.
<SignIn
onSubmit={handleSignIn}
classname="SignIn"
/>
.SignIn(Classname you provide as a prop) .signin-container(choose component you want){
//add CSS here
}
<SignIn
onSubmit={handleSignIn}
OAuthComponent={OAuth}
placeholders={{
email: "Enter your email",
password: "Enter your password",
}}
buttonText="Sign In"
/>
MIT License
FAQs
An easy-to-use React npm package for seamless SignIn and SignUp functionality with customizable themes and OAuth integration.
We found that oneclickauth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.