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
- I recently applied for the free plan und...
I recently applied for the free plan under the GitHub Student Developer Pack. However, my billing status still shows $15, and it mentions that this amount will ...
- Bug Report: Appwrite Console UI Issue on...
Steps to Reproduce: - Navigate to any collection page in the Appwrite console UI. - Open the menu and click on "Create Collection." - Observe that the dialog to...
- Current User is Not authorized
recreating same Thread