D_ChitaleOriginal post
Web Developer
I am trying to implement login system in my web app but its showing error
const handleLogin = async (e) => {
e.preventDefault();
try {
// Create a session using email and password
const session = await account.createSession(email, password); // Only email and password should be passed here
console.log('Login successful:', session);
navigate('/profile'); // Redirect to profile or dashboard after successful login
} catch (err) {
console.error('Login failed:', err.message);
setError('Login failed: ' + err.message);
}
};
this is my login code
Summary
Developers are experiencing an error in the login system implementation. The code provided is attempting to create a session using email and password inputs, but it is throwing an error. The suggested solution is to check the 'account.createSession' function for potential issues or incorrect usage.