Priyanka
CCConvex Community
•Created by Priyanka on 9/10/2024 in #support-community
when to use getUserIdentity() and getAuthUserId()?
import { mutation } from "../_generated/server";
import { getAuthUserId } from "@convex-dev/auth/server";
export const doSomething = mutation({
args: {/* ... */},
handler: async (ctx, args) => {
const userId = await getAuthUserId(ctx);
if (userId === null) {
throw new Error("Client is not authenticated!")
}
const user = await ctx.db.get(userId);
// ...
},
});
This is the mutation function directly taken from the documentation
8 replies
CCConvex Community
•Created by Priyanka on 9/10/2024 in #support-community
when to use getUserIdentity() and getAuthUserId()?
it says the client is not authenticated
8 replies
CCConvex Community
•Created by Priyanka on 9/10/2024 in #support-community
when to use getUserIdentity() and getAuthUserId()?
I need to retreive the user_id from the users table, but when I use the mutation, I get it as null instead of the user_id.
8 replies
CCConvex Community
•Created by Priyanka on 9/10/2024 in #support-community
when to use getUserIdentity() and getAuthUserId()?
What is the process used in convex side after the authentication is done in github, do we need to write a code to get the access token from the code which is present in the url ?
8 replies
CCConvex Community
•Created by Priyanka on 9/10/2024 in #support-community
when to use getUserIdentity() and getAuthUserId()?
The SITE_URL is configured as http://localhost:8501
8 replies
CCConvex Community
•Created by Priyanka on 9/10/2024 in #support-community
when to use getUserIdentity() and getAuthUserId()?
I am using Github for authentication using convex auth. When the authentication is done, there is a new link generated as http://localhost:8501/?code=37378399. When I used the mutation function as provided here https://docs.convex.dev/auth/database-auth#mutation-for-storing-current-user. I get the identity as null and the below error:
[LOG] 'Identity:' null
[ERROR] 'Error in mutation handler:' [Error: Called storeUser without authentication present or missing email]
Error checking user authentication: [Request ID: 2be5d9e1e54f7137] Server Error
Uncaught Error: Called storeUser without authentication present or missing email
Could anyone help to resolve this ? Thank you!
8 replies
CCConvex Community
•Created by Priyanka on 8/23/2024 in #support-community
Hi, I am facing some error in while inserting data into the table created on convex database.
I fixed the error. There was some issue with the schema of the users table and the food_items table to which I was trying to insert the data into. Now it's resolved. Thank you @ari !
12 replies
CCConvex Community
•Created by Priyanka on 8/23/2024 in #support-community
Hi, I am facing some error in while inserting data into the table created on convex database.
No, I don't see the error. Okay, I'll update the code . thank you!
12 replies
CCConvex Community
•Created by Priyanka on 8/23/2024 in #support-community
Hi, I am facing some error in while inserting data into the table created on convex database.
there is no detailed information about the error.
12 replies
CCConvex Community
•Created by Priyanka on 8/23/2024 in #support-community
Hi, I am facing some error in while inserting data into the table created on convex database.
12 replies
CCConvex Community
•Created by Priyanka on 8/23/2024 in #support-community
Hi, I am facing some error in while inserting data into the table created on convex database.
just a min
12 replies
CCConvex Community
•Created by Priyanka on 8/23/2024 in #support-community
Hi, I am facing some error in while inserting data into the table created on convex database.
yes I can see
12 replies
CCConvex Community
•Created by Priyanka on 8/23/2024 in #support-community
Hi, I am facing some error in while inserting data into the table created on convex database.
12 replies