Ferdinand
Ferdinand
CCConvex Community
Created by Ferdinand on 8/17/2024 in #support-community
AuthSessions and AuthRefreshTokens not deleted after signOut
Hello there! I am using convex auth with google provider and everything works perfectly in production and development. The issue here is every time I sign out the sessions are not deleted in prod and dev. That means if I sign in again, a second session will be created, and so on.
10 replies
CCConvex Community
Created by Ferdinand on 8/16/2024 in #support-community
New AuthSessions and AuthRefreshTokens after each login
Hello there! I have this issue, everytime I login with my google provider I have a new authSessions and authRefreshTokens. here is my auth code:
export const { auth, signIn, signOut, store } = convexAuth({
providers: [Google],
callbacks: {
async createOrUpdateUser(ctx, args) {
if (args.existingUserId) {
return args.existingUserId;
}

return ctx.db.insert('users', {
email: args.profile.email,
emailVerified: args.profile.emailVerified,
image: args.profile.image,
name: args.profile.name,
phone: args.profile.phone,
phoneVerified: args.profile.phoneVerified,
role: 'user',
});
},
},
});
export const { auth, signIn, signOut, store } = convexAuth({
providers: [Google],
callbacks: {
async createOrUpdateUser(ctx, args) {
if (args.existingUserId) {
return args.existingUserId;
}

return ctx.db.insert('users', {
email: args.profile.email,
emailVerified: args.profile.emailVerified,
image: args.profile.image,
name: args.profile.name,
phone: args.profile.phone,
phoneVerified: args.profile.phoneVerified,
role: 'user',
});
},
},
});
25 replies
CCConvex Community
Created by Ferdinand on 8/12/2024 in #support-community
Convex Auth with Next js always return null both in server and client?
Hello there! I am using the latest next js and convex. I scrupulously followed the convex auth doc for next js with google. When I login everything works well even in the middleware but I am unable to retrieve the user info through the middleware as well as the client using either fetchQuery or useQuery.
13 replies
CCConvex Community
Created by Ferdinand on 7/26/2024 in #support-community
fetch request on internal action
I am trying to send an email using nodemailer and gmail. I created an api in next js api app router. export const newUserEmail = internalAction({ args: { email: v.string(), name: v.string() }, handler: async (ctx, args) => { const newUser = await fetch('http://localhost:3000/api/email/newUser', { method: 'POST', body: JSON.stringify({ email: args.email, name: args.name }), }); console.log('convex email', newUser); return newUser; }, }); I am getting this error from convex log: Uncaught Error: Request to http://localhost:3000/api/email/deleteUser forbidden. Please how can I resolve this.
10 replies