Chirag AggarwalOriginal post
Rank 1: Thread
my user is logged in via github oauth, but still getting this error
const response = await database.createDocument(
process.env.NEXT_PUBLIC_APPWRITE_DATABASE_ID!,
process.env.NEXT_PUBLIC_APPWRITE_COLLECTION_ID!,
ID.unique(),
{
userId: user.current?.$id,
[field]: value,
},
);
setDocumentId(response.$id);
Summary
Developers are experiencing authorization issues and incorrect user count display in a GitHub OAuth setup. The provided code snippet appears to be creating a document, linking it to the current user through their ID. Check if the user has the necessary permissions, and investigate why only one user is being counted.