Hello team…
I had a project built sometimes ago which works just fine both in development and production As time goes by, I discovered users couldn’t login nor sign up anymore, users details gets stored in the database, but my app just doesn’t proceed to home page.
I had the following code and console error:
export async function signInAccount(user: {email: string; password: string;}) { try{ const session = await account.createEmailSession(user.email, user.password); return session; } catch (error) { console.log(error) } }
This code returned “Creation of a session is prohibited when a session is active”
I did some research and replaced with the following code:
export async function signInAccount(user: {email: string; password: string;}) { try{ await account.deleteSessions(); const session = await account.createEmailSession(user.email, user.password); return session; } catch (error) { console.log(error); } }
Now…the new code throws an error “Appwrite is using local storage for session management, increase your security by adding a custom domain in your API endpoint” I huge the team to support.
Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
Are you requiring users to always log in? And you're not checking if they're logged in on app start?
There’s a check for that And everything worked just fine when i first launched If a user is logged in, they don’t have to login again, long as the session is still active. I’ve tried on new devices I’ve never logged in to, but still the same error
Would you please check the request details for the failed request and look at the request headers
I’ll do just that and get back in few minutes
Recommended threads
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...
- Deploy function not working - 503
Hellon i get this error message, when i try to deploy a new version of a function <html><body><h1>503 Service Unavailable</h1>No server is available to handle...