Hello, I'm using the same flutter code on my web and my mobile version. I can still log in with my ios and android but only after I get the guest scope missing error and then I hot reload and I'm logged in. This started happening when I updated to the latest version. Tried downgrading didn't help. Do I need to ad self-signed in my main.
what's your code that throws the scope error?
Same as my normal web code ```@override Future signIn( {required String email, required String password, required BuildContext context}) async { try { if (isValidEmail(email)) { final session = await context.authNotifier .createEmailSession(email: email, password: password); _currentUser = await _account.get(); return right(session); } final document = await _db.listDocuments( databaseId: AppwriteConstants.databaseId, collectionId: AppwriteConstants.usersCollection, queries: [ Query.search('userName', email), ], ); final user = UserModel.fromMap(document.documents.first.data); final responseWithUserName = await context.authNotifier.createEmailSession( email: user.email, password: password, ); _currentUser = await _account.get();
return right(responseWithUserName);
} on AppwriteException catch (e, stackTrace) {
Failure(e.message ?? 'Some unexpected error occurred', stackTrace);
} catch (e, stackTrace) {
return left(
Failure(e.toString(), stackTrace),
);
}
}```
I use both username and email to log in. However even when I just use email I still get the same guest scope missing error
fyi, you can add dart after the 3 backticks to add syntax highlighting
so you're saying that await _account.get() is throwing the exception?
I don't even know which part is causing the exception
Got you and I'll resend the code
Same as my normal web code ``` dart @override Future signIn( {required String email, required String password, required BuildContext context}) async { try { if (isValidEmail(email)) { final session = await context.authNotifier .createEmailSession(email: email, password: password); _currentUser = await _account.get(); return right(session); } final document = await _db.listDocuments( databaseId: AppwriteConstants.databaseId, collectionId: AppwriteConstants.usersCollection, queries: [ Query.search('userName', email), ], ); final user = UserModel.fromMap(document.documents.first.data); final responseWithUserName = await context.authNotifier.createEmailSession( email: user.email, password: password, ); _currentUser = await _account.get();
return right(responseWithUserName);
} on AppwriteException catch (e, stackTrace) {
Failure(e.message ?? 'Some unexpected error occurred', stackTrace);
} catch (e, stackTrace) {
return left(
Failure(e.toString(), stackTrace),
);
}
}```dart
Nevermind I tried the dart syntax and couldn't make it show up on discord ๐ and with the code not sure why it throws the exception only on mobile and it didn't used to before I updated to the latest appwrite
you should be adding dart right after the first 3 backticks only (on the same line as the backticks)
you should be able to see from the stacktrace or by using the debugger
you said you upgraded. you upgraded the Appwrite SDK? or Appwrite? What version of each are you on?
I updated both. I'm on appwrite sdk 11 and appwrite 1.4.2
Maybe because I updated the appwrite sdk?
version 11.0.0 of the sdk should be fine with 1.4.2 of Appwrite.
It would help if you figured out which API call was throwing the exception.
Also, FYI, 1.4.3 was released so you might want to upgrade to that
Recommended threads
- Issues with Appwrite and networking
Hi, Iโve been having some real issues with hosting appwrite, I have it running with the hostname โlocalhostโ and I used to also be able to use the machines IP ...
- Appwrite usage is reporting inaccurate i...
I was using Appwrite mainly for the site hosting on the free tier when I saw that I am using 5 GB storage when Appwrite only allows you to use 2 GB. Itโs been l...
- All Apple platforms are invalidated on t...
Just saw a lot of errors coming from iOS apps where Cloud is throwing **403** with type **general_unknown_origin**. Culprit is that all Apple platforms suddenly...