JWT authentication

I'm using Supabase as a database and want to use my own third-party part JWT that I'm creating, till now i believe I'm done with creating the JWT after the user login(web3 login), but my issue at the end I'm doing this
const token =jwt.sign(
    {
      aud: "authenticated",
      exp: Math.floor(new Date().getTime() / 1000) + 60 * 60 * 24 * 6,
      sub: data.id,
      app_metadata: {
        provider: "wallet",
      },
      user_metadata: {
        id : data.id,
        wallet: data.address,
      },
      role: "authenticated"
    },
    process.env.SUPABASE_JWT_SECRET as string
  )
  const { error: authErr } = await supabaseServer.auth.setSession({
    access_token: token,
    refresh_token: token,
  })


and I'm getting an error AuthApiError: User not found.

The issue is that I'm using storing the user in public.users instead of auth.users since I'm doing my own auth so I'm not sure how I would go about managing users id's
Was this page helpful?