Hello, I am creating a user table with the code below.
export const create = mutation({
args: {},
handler: async (ctx, args) => {
const identity = await ctx.auth.getUserIdentity();
if (!identity) {
throw new Error("Not authenticated");
}
const userId = identity.subject;
const userName = identity.name;
const user = await ctx.db.insert("users", {
userId,
userName,
});
return user;
}
});
Is there a way to get a name from the client and update the identity.name with that value?