Hi, nice to meet you! Apologies in advance, as I’m new to Appwrite and currently migrating from Firebase.
In my current project, I’m using PHP with Laravel, and I’m implementing user authentication system (Login and Logout). However, I seem to have missed something, as I encountered an error during the logout process:
(role: applications) missing scope (account).
I’d greatly appreciate your help in identifying where I might have gone wrong. Here, I’ve included the code for both Login and Logout.
Thank you so much in advance for your support, and I'm sorry for taking up your time.
are you using the same Client instance in the method params or creating a new one?
Oh, I forgot to include the code for $client in Laravel's AppServiceProvider. Here's the code attached.
Assuming this is a singleton that is consistent across the entire session, it seems okay. I am also assuming the setSession('user') is either a placeholder or do you do some data injection there? As it needs to be the user session and not just user.
I am not entirely sure but (role: applications) missing scope (account) already means that the user is not signed in. Does this happen only on logout?
I’ve updated the code and removed the setSession('user') part, as it was just something I tried while troubleshooting the error.
This issue happens when I click Logout, and it seems like the session isn’t actually deleted. There was a point during my code adjustments where it redirected to the login page (as if it worked), but when I manually accessed the dashboard page, it allowed access (as if the session was still active).
Finally, when I rewrote the code from scratch, it didn’t work and resulted in the missing scope error that we’re currently discussing.
can you confirm if the user has session before deleting? maybe try account->get() and print it? does it print the user info?
Ahh, I see. Let me try implementing it first and I’ll update the results here.
Hi, here are the results I got. It seems like the account isn’t actually logged in, right? I think I don’t fully understand how to authenticate users. Could the issue be with the login process? 😟
I think the issue might be the fact that you might are not using the session on the client after login [setSession]. You are using setKey as well, not sure if its required. Refer - https://appwrite.io/blog/post/introducing-support-for-server-side-rendering, the example uses js/react but should give you an idea.
Recommended threads
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...
- Courtesy limit reset for non-profit migr...
Hi Team! I'm the architect for a 501(c)(3) non-profit project (Aaria's Blue Elephant) and we just hit our Free plan Database Read limit (currently at 164%). Th...