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
- [SOLVED] React Native Appwrite SDK not w...
So I'm trying to generate a unique ID using the ID.unique() and its generating properly, but its saying its longer than 36 characters but it isnt.. ```typescri...
- Unable to execute function
i wanna also ask why im facing the error in appwrite functions Traceback (most recent call last): File "/usr/local/server/src/server.py", line 106, in action...
- Invalid Document Structure again
Facing the same error that was after appwrite down. Now on existing document rewriting