Closed Kuromory closed 3 months ago
Hi @Kuromory Thanks for opening the issue.
Appwrite's get
function would throw an error when the user is not logged in, this is the expected behavior.
Though, the createEmailPasswordSession
should initiate the session, to further debug it you can wrap both functions in try/catch blocks to see why the session creation didn't went through.
try {
var session = await _account.createEmailPasswordSession(
email: event.email,
password: event.password,
);
} catch (e) {
// ...
}
try {
final user = await _account.get();
} catch (e) {
// ...
}
final teams = await _teams.list();
Or create a support ticket in our Discord
Hey @byawitz I have all in a try/catch block but for testing I did it like you told me so and it still does NOT work... Just that you know, when I use web (Chrome) it does work without a problem... it only does not work on windows... It also worked around 2 weeks ago... but since then I updated appwrite and flutter to the newest version, maybe this was the cause it wont work anymore?
What's the error in Windows? for the first try/catch
block?
If you mean in the method createEmailPasswordSession
then there is no error...
I just get the error after "sucessful" Login... I also have the session in my appwrite dashboard visible...
Do you guys create some kind of file/cache or something that might needed to be deleted? I added OAuth2 support to my app and it might got some things mixed up where it can't detect I am already logged in?
I got it working! I had to delete your guys %USERNAME%\Documents\cookies\
folder... you might wanna tell people in your docs where you save your stuff... took me now over a week to find it...
👟 Reproduction steps
I use the selfhosted version of appwrite (1.5.7) and want to login with email/password. here is the code
👍 Expected behavior
I get the account values like name/team memberships etc.
👎 Actual Behavior
I get this error: flutter: AppwriteException: general_unauthorized_scope, User (role: guests) missing scope (account) (401) flutter: #0 ClientMixin.prepareResponse (package:appwrite/src/client_mixin.dart:73:9)
1 ClientIO.call (package:appwrite/src/client_io.dart:383:14)