igor9silvaI
Convex Community12mo ago
43 replies
igor9silva

Convex Auth session keeps dying

Hi,

My app session keeps dying out of nowhere. It happens ~daily (interestingly, usually happens at the same time as on the Convex Dashboard).

Most of the times I open the browser (Arc) and both my app and Convex Dashboard are logged out, so I re-sign-in on both. Sometimes it happens while I'm using it (did just now).

When it happens, both JWT and refreshToken are still set on localStorage (3rd image). I see nothing on server logs besides my queries suddenly rejecting auth.

I've been trying to understand session duration behavior for a while but I feel I'm kinda lost. Any advice would be appreciated.

auth.ts
export const { auth, signIn, signOut, store } = convexAuth({
    providers: [Google],
    jwt: {
        durationMs: 1000 * 60 * 60 * 24 * 7 /* 7 days */,
    },
    session: {
        inactiveDurationMs: 1000 * 60 * 60 * 24 * 7 /* 7 days */,
    },
    callbacks: {
        async afterUserCreatedOrUpdated(ctx, args) {
            console.log('afterUserCreatedOrUpdated', ctx, args);
        },
    },
});


auth.config.ts
export default {
    providers: [
        {
            domain: process.env.CONVEX_SITE_URL,
            applicationID: 'convex',
        },
    ],
};
image.png
image.png
image.png
Was this page helpful?