Invalid userId: Parameter must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, period, hyph
- 0
- React Native

Bonjour j'ai la même erreur mais je n'arrive pas à la résoudre avec votre réponse pouvez vous m'aider voici mon code : import { Account, Avatars, Client, Databases, ID, Query, Storage, } from "react-native-appwrite"; export const appwriteConfig = { endpoint: 'https://cloud.appwrite.io/v1', platform: '...', projectId: '...', databaseId: '...', userCollectionId: '...', videoCollectionId: '...', storageId:'...'
} // Init your React Native SDK
const client = new Client();
client .setEndpoint(appwriteConfig.endpoint) .setProject(appwriteConfig.projectId) .setPlatform(appwriteConfig.platform);
const account = new Account(client); const storage = new Storage(client); const avatars = new Avatars(client); const databases = new Databases(client);
// Register user export async function createUser(email, password, username) { try { const newAccount = await account.create( ID.unique(), email, password, username );
if (!newAccount) throw Error;
const avatarUrl = avatars.getInitials(username);
await signIn(email, password);
const newUser = await databases.createDocument(
appwriteConfig.databaseId,
appwriteConfig.userCollectionId,
ID.unique(),
{
accountId: newAccount.$id,
email: email,
username: username,
avatar: avatarUrl,
}
);
return newUser;
} catch (error) { throw new Error(error); } } export async function signIn(email, password) { try { const session = await account.createSession(email, password);
return session;
} catch (error) {
console.error("Error creating user: ", error.message, error);
throw new Error(error)
}
}

look at the details for the account.createSession()
function

C'est à dire ? Pouvez vous me dire où est mon erreur s'il vous plaît ?
Recommended threads
- Expo-web session issue
In web I created a session using oauth. I run the app logged in but closed the terminal and ran again opened the app(I have now 2 running app in different...
- I can't add relationship attributes on m...
How can I make it work in selfhosted Appwrite?
- [AppwriteException: The current user is ...
i get this error when i try to create a document in my react native app, even tho permissions for db are set to any, and the document is created in the db despi...
