Back

Auth Doubts

  • 0
  • React Native
saksham
13 May, 2024, 17:39

Hi team, I'm trying to make signUp and signIn screens using Auth but i keep getting the error "account.createEmailSession is not a function" but it does creates a user in my appwrite Auth and the other error i get is " AppwriteException: Creation of a session is prohibited when a session is active". Im using react native SDK. Please help!!

TL;DR
Developers should call `account.get()` to check for an active session before completing the login process. Use `account.createEmailPasswordSession()` for user creation. The error "account.createEmailSession is not a function" is likely due to incorrect syntax. The "Creation of a session is prohibited when a session is active" error occurs when attempting to log in while already logged in.
ideclon
13 May, 2024, 17:52

It’s account.createEmailPasswordSession() now

ideclon
13 May, 2024, 17:53

And the “Creation of a session is prohibited when a session is active” means you’re already logged in and you’re trying to log in again.

ideclon
13 May, 2024, 17:54

You should call account.get() to check if there’s an active session, and only complete the login process if there isn’t.

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