1.3.3 • Published 11 months ago

custom-login-react v1.3.3

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

custom-login-react

A simple and customizable login and registration component for React.

For detailed documentation, check out the Wiki.

Installation

npm install custom-login-react

or with Yarn:

yarn add custom-login-react

Usage

import React from 'react';
import './App.css';
import { Login } from 'custom-login-react';

function App() {
  const handleLogin = (event: React.FormEvent<HTMLFormElement>) => {
    event.preventDefault();
    console.log('Login =>');
    console.log('Email:', event.currentTarget[0].value);
    console.log('Password:', event.currentTarget[1].value);
  };

  const handleRegister = (event: React.FormEvent<HTMLFormElement>) => {
    event.preventDefault();
    console.log('Register =>');
    console.log('Username:', event.currentTarget[0].value);
    console.log('Email:', event.currentTarget[1].value);
    console.log('Password:', event.currentTarget[2].value);
  };

  return (
    <div className="App">
      <Login onLogin={handleLogin} onRegister={handleRegister} />
    </div>
  );
}

export default App;

Props

PropTypeDescription
onLogin(event: React.FormEvent<HTMLFormElement>) => voidCallback function triggered on login submission.
onRegister(event: React.FormEvent<HTMLFormElement>) => voidCallback function triggered on registration submission.

Important Notes

⚠️ Security Warning

  • The password is received in plain text. You must hash it before storing or transmitting it to your backend for security reasons.
  • Consider using a library like bcrypt or argon2 to hash passwords before sending them to your server.

License

This project is licensed under the MIT License.

1.3.3

11 months ago

1.3.2

11 months ago

1.3.1

11 months ago

1.3.0

11 months ago

1.2.9

12 months ago

1.2.6

12 months ago

1.2.5

12 months ago

1.2.4

12 months ago

1.2.2

12 months ago

1.2.1

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago