why const { authenticate } = require(‘ldap-authentication’) bug file ?
Error : Module not found: Error: Can’t resolve ‘fs’ in ‘C:Userst847112DesktopReactJSreel_management_ver7node_modules@ldapjsasn1lib’
File name : Login_form.js
import { useState } from "react";
import './Login_form.css';
const { authenticate } = require('ldap-authentication') // ***** bug *****
export default function Form() {
// States for registration
const [name, setName] = useState("");
const [password, setPassword] = useState("");
// Handling the name change
const handleName = (e) => {
setName(e.target.value);
};
// Handling the password change
const handlePassword = (e) => {
setPassword(e.target.value);
};
// Handling the form submission
const handleSubmit = (e) => {
console.log({name})
console.log({password})
};
return (
<div className="form">
<header>
<table className='table_login_form'>
<tbody>
<tr>
<td ><span>User Registration</span></td>
</tr>
<tr>
<td>
<form onSubmit={handleSubmit} >
{/* Labels and inputs for form data */}
<label className="label">Name</label>
<input
required
onChange={handleName}
className="input"
value={name}
type="text"
/>
<label className="label">Password</label>
<input
required
onChange={handlePassword}
className="input"
value={password}
type="password"
/>
<button className="btn" type="submit">
Submit
</button>
</form>
</td>
</tr>
</tbody>
</table>
</header>
</div>
);
}
if i deleted const { authenticate } = require(‘ldap-authentication’)… work fine but I need LDAP Authentication.