Hello all ,im trying to use JWT for all auth and replace bearer non jwt token. there two problems now ,
first thing the jwt plugin only return jwt as set-auth-jwt on get-session but not in sign in Endpoint like bearer plugin . second thing is this jwt from jwt plugin is not working when used in authorization header .
My goal is only to skip checking session from database because on my workers +neon db the min latency is 200ms on any fetch from db and that too much time .
I got very frustrated on this problem trying to make custom plugin but the problem is custom plugings require too much functions from better-auth core and other better auth packages.
I managed to make plugin but setting session from plugin not easy without setsessioncookie wich use setCookieCache and other functions from better-auth/cookies module why this is complicated in better auth why they use cookies as default way to store sessions and relay too much on plugins to handle token type and token set to cookies or headers .cant this plugins just do context.setsession on after hook .and context.setToken on before hook and auth api auto set this according to config