when creating an account I use following methods:
Future<void> register(String email, String password, String username) async {
final user = await account.create(userId: ID.unique(), email: email, password: password);
await account.createEmailPasswordSession(email: email, password: password);
final userId = UserID(user.$id);
await _createUsername(userId, username);
await _createUser(userId, username);
await getAccount(); // push to stream
}
Future<void> _createUser(UserID userId, String username) async {
// try {
await db.createRow(
databaseId: AppwriteBootstrap.databaseId,
tableId: AppwriteBootstrap.usersCollectionId,
rowId: userId.value,
data: {
'bio': null,
'photoUrl': null,
'username': username,
},
permissions: [
Permission.read(Role.users()),
Permission.update(Role.user(userId.value)),
Permission.delete(Role.user(userId.value)),
],
);
//} catch (_) {
return;
//}
}
Future<Row> _createUsername(UserID userId, String username) async {
return await db.createRow(
databaseId: AppwriteBootstrap.databaseId,
tableId: AppwriteBootstrap.usernamesCollectionId,
rowId: username,
data: {
'user': null
},
permissions: [
Permission.read(Role.any()),
Permission.update(Role.user(userId.value)),
Permission.delete(Role.user(userId.value)),
],
);
}
and _createUsername does work properly, creating the row with the username as id parameter. But when creating the user informations in _createUser, linking it to its relation in usernames, I get the missing authentication error. Same scopes, same restrictions in cloud, everything should be smooth.
If you need me to provide more specific info, @tell me.
Recommended threads
- Appwrite Storage error 503s for automate...
I'm facing error 503s from Appwrite after about 5-6 seconds of making AI requests from my tool with images and files above 20MB (=> not inline base64 used, but ...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...
- [SOLVED] Paused project can't activate
~~Error: **Invalid console fingerprint** last usage: **daily** no idea why it's paused tried relogin~~ tried relogin in incognito mode and it asked for email...