FerdinandF
Convex Community2y ago
24 replies
Ferdinand

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',
            });
        },
    },
}); 
Was this page helpful?