Hello! I am trying to make the user log out but its not working. Here is the error I am getting: This is the code for the logout:
async function logout() {
if (isLoggedin) {
try {
await appwriteUser.deleteSession('current');
} catch (error) {
console.error('Failed to logout:', error);
}
} else {
console.error('User is not logged in');
}
}
I also need help with teams... I want the user to join a team as soon as they log in: here is the code:
await appwriteUser.create(ID.unique(), email, password, name).then(async () => {
await appwriteTeams.createMembership(
'Teachers',
email
)
yet this dcoes not work. please help!
please help!
Seems like you are running that logout code in server-side. Try to run on client-side
how do I do that?
do I try to run it in prod?
Are coding in Nextjs?
sveltekit
what about the teams thing tho?
I'm not expert in that framework. try to use bard or bing-chatgpt to find better approach. In my case when the similar error I just switched to client-side and solved the problem
ok
It looks like you don’t currently have an active session to delete
As for the Teams, only owners of a team can add users to the Team
oh
is there a way to automate the process?
or is it manual?
You could have a Function that triggers on user login?
an appwrite function or a ts function
Appwrite
oh alr\
Recommended threads
- I'm getting error Invalid `url` param: I...
``` 2025-10-26T12:52:02.292Z [error] AppwriteException: Invalid `url` param: Invalid URI. Register your new client (vercel.com) as a new Web platform on your pr...
- Deployed website on Sites not opening.
Hey y'all. I deployed a site as a submission for the Sites Hackathon, which was nearly a month ago. After the hackathon, I never really opened the site. Now, wh...
- I'm getting error Invalid `url` param: I...
``` 2025-10-26T12:52:02.292Z [error] AppwriteException: Invalid `url` param: Invalid URI. Register your new client (vercel.com) as a new Web platform on your pr...