Skip to content

Custom JWT: remains unauthenticated despite providing the auth provider #108

@antoineol

Description

@antoineol

Hi team,

I am trying to make the custom JWT auth work, but the auth state remains desperately unauthenticated, despite following strictly the doc steps. There is no error, nothing else, so I suspect a step is missing, but I can't find which one.

Minimal repro: https://github.com/antoineol/convex-jwt

git clone https://github.com/antoineol/convex-jwt.git
cd convex-jwt
bun install
bun dev

FYI, steps followed to build it:

PS: .env.local is versioned on purpose with RSA public/private key for the demo, so that all pieces are there to reproduce.

Thanks a lot for your help! 🙏


More context: I'm trying to add a nextjs + convex app next to our product existing app (Rails + devise + postgres) with live sync, to progressively migrate some pages while preserving a nice user navigation experience. It works great, except the auth.


Edit: I have the feeling the issue is related to the useProviderXAuth (or useAuthFromProviderX) that is required to have a specific behavior (not documented here), like prefetching the token without waiting for an explicit call to fetchAccessToken / getToken. But maybe not with an initial value either? I'm still trying to clarify it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions