bear
bear
CCConvex Community
Created by bear on 10/1/2024 in #support-community
How do I enable console.log?
console.logs, console.infos don't seem to show up in the log in the dashboard, nor when using npx convex dev --tail-logs, am I missing something 🙂 ?
37 replies
CCConvex Community
Created by bear on 9/30/2024 in #support-community
How do I authenticate a query?
I'm trying to use convex-auth in svelte, I'm retreiving the accessToken as follows, this gives me a token and a refreshToken
const tokens = await client.action(api.auth.signIn, {
provider: 'password',
params: {
flow: 'signIn',
email,
password
}
});
const tokens = await client.action(api.auth.signIn, {
provider: 'password',
params: {
flow: 'signIn',
email,
password
}
});
however when trying to retrieve the current user, through const me = await client.query(api.users.currentUser, {}); for the API
export const currentUser = query({
args: {},
handler: async (ctx) => {
const userId = await getAuthUserId(ctx);
if (userId === null) {
return null;
}
return await ctx.db.get(userId);
}
});
export const currentUser = query({
args: {},
handler: async (ctx) => {
const userId = await getAuthUserId(ctx);
if (userId === null) {
return null;
}
return await ctx.db.get(userId);
}
});
it always returns null
4 replies