Back

Need Help in Login page

  • 0
  • Web
D_Chitale
12 Sep, 2024, 05:58

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

TL;DR
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.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more