Tenuka
Tenuka
Explore posts from servers
BABetter Auth
Created by Tenuka on 5/9/2025 in #help
JWT Err : Key for the EdDSA algorithm must be one of type CryptoKey
{"keys":[{"crv":"Ed25519","x":"E1Wd_QpdDtT914FDNKJNuPiXvdeUDMRaTtVN0vPRG6U","kty":"OKP","kid":"YIliaKY8X4nDAfHXWJzOpJrzYqgBQ11Z"}]}
{"keys":[{"crv":"Ed25519","x":"E1Wd_QpdDtT914FDNKJNuPiXvdeUDMRaTtVN0vPRG6U","kty":"OKP","kid":"YIliaKY8X4nDAfHXWJzOpJrzYqgBQ11Z"}]}
I've keep getting the bellow error in better auth,
I've keep getting the bellow error in better auth,
jwt({ jwt: { definePayload({ user }) { return { role: user.role, email: user.role }; } } }),
X [ERROR] Token validation failed: TypeError: Key for the EdDSA algorithm must be one of type CryptoKey, KeyObject, or JSON Web Key. Received an instance of CryptoKey

at asymmetricTypeCheck
(file:///D:/PROJECTS/avera-hills-web/node_modules/.pnpm/[email protected]/node_modules/jose/dist/webapi/lib/check_key_type.js:88:15)
at default
(file:///D:/PROJECTS/avera-hills-web/node_modules/.pnpm/[email protected]/node_modules/jose/dist/webapi/lib/check_key_type.js:124:9)
at flattenedVerify
(file:///D:/PROJECTS/avera-hills-web/node_modules/.pnpm/[email protected]/node_modules/jose/dist/webapi/jws/flattened/verify.js:76:5)
at async compactVerify
(file:///D:/PROJECTS/avera-hills-web/node_modules/.pnpm/[email protected]/node_modules/jose/dist/webapi/jws/compact/verify.js:15:22)
at async jwtVerify
(file:///D:/PROJECTS/avera-hills-web/node_modules/.pnpm/[email protected]/node_modules/jose/dist/webapi/jwt/verify.js:5:22)
at async validateToken
(file:///D:/PROJECTS/avera-hills-web/server/actions/user/user-jwt.ts:14:24)
at async getJWTPayload
(file:///D:/PROJECTS/avera-hills-web/server/actions/user/user-jwt.ts:31:19)
at async checkAdmin (file:///D:/PROJECTS/avera-hills-web/server/routers/admin-router.ts:65:18)
at async Object.handler
(file:///D:/PROJECTS/avera-hills-web/server/routers/admin-router.ts:418:4)
at null.<anonymous> (async
file:///D:/PROJECTS/avera-hills-web/.wrangler/tmp/dev-1f7Hlj/index.js:37137:28)
X [ERROR] Token validation failed: TypeError: Key for the EdDSA algorithm must be one of type CryptoKey, KeyObject, or JSON Web Key. Received an instance of CryptoKey

at asymmetricTypeCheck
(file:///D:/PROJECTS/avera-hills-web/node_modules/.pnpm/[email protected]/node_modules/jose/dist/webapi/lib/check_key_type.js:88:15)
at default
(file:///D:/PROJECTS/avera-hills-web/node_modules/.pnpm/[email protected]/node_modules/jose/dist/webapi/lib/check_key_type.js:124:9)
at flattenedVerify
(file:///D:/PROJECTS/avera-hills-web/node_modules/.pnpm/[email protected]/node_modules/jose/dist/webapi/jws/flattened/verify.js:76:5)
at async compactVerify
(file:///D:/PROJECTS/avera-hills-web/node_modules/.pnpm/[email protected]/node_modules/jose/dist/webapi/jws/compact/verify.js:15:22)
at async jwtVerify
(file:///D:/PROJECTS/avera-hills-web/node_modules/.pnpm/[email protected]/node_modules/jose/dist/webapi/jwt/verify.js:5:22)
at async validateToken
(file:///D:/PROJECTS/avera-hills-web/server/actions/user/user-jwt.ts:14:24)
at async getJWTPayload
(file:///D:/PROJECTS/avera-hills-web/server/actions/user/user-jwt.ts:31:19)
at async checkAdmin (file:///D:/PROJECTS/avera-hills-web/server/routers/admin-router.ts:65:18)
at async Object.handler
(file:///D:/PROJECTS/avera-hills-web/server/routers/admin-router.ts:418:4)
at null.<anonymous> (async
file:///D:/PROJECTS/avera-hills-web/.wrangler/tmp/dev-1f7Hlj/index.js:37137:28)
1 replies
BABetter Auth
Created by Tenuka on 4/6/2025 in #help
Zero Sync Authentication
18 replies
BABetter Auth
Created by Tenuka on 4/3/2025 in #help
Better Auth + Hono + Nextjs ( JStack ) Cookies
No description
2 replies
TTCTheo's Typesafe Cult
Created by Tenuka on 3/16/2025 in #questions
Uploadthing Path Not Found HONO
appRouter.all("/uploadthing", (ctx) => {
return uploadthingHandlers({ ...ctx.env, ctx: ctx.executionCtx })(
ctx.req.raw
);
});
appRouter.all("/uploadthing", (ctx) => {
return uploadthingHandlers({ ...ctx.env, ctx: ctx.executionCtx })(
ctx.req.raw
);
});
const api = j
.router<{}, AppContext>()
.basePath("/api")
.use(corsMiddleware)
.onError(j.defaults.errorHandler);

const appRouter = j.mergeRouters(api, {
email: emailRouter,
admin: adminRouter,
ai: aiRouter,
property: propertyRouter,
uploadthing: uploadthingRouter,
map: mapsRouter,
blog: blogRouter,
room: roomRouter,
user: userRouter,
});
const api = j
.router<{}, AppContext>()
.basePath("/api")
.use(corsMiddleware)
.onError(j.defaults.errorHandler);

const appRouter = j.mergeRouters(api, {
email: emailRouter,
admin: adminRouter,
ai: aiRouter,
property: propertyRouter,
uploadthing: uploadthingRouter,
map: mapsRouter,
blog: blogRouter,
room: roomRouter,
user: userRouter,
});
This is my AppRouter config for /api path so the url is 127.0.0.1:8787, Ive used jstack as tho explained but the hono api dosent get the uploadthing path
[wrangler:inf] GET /api/uploadthing 404 Not Found (21ms)
[wrangler:inf] GET /api/uploadthing 404 Not Found (21ms)
2 replies
BABetter Auth
Created by Tenuka on 3/14/2025 in #help
Hono dosen't set cookies, so session returns Null
No description
2 replies
BABetter Auth
Created by Tenuka on 3/13/2025 in #bug-reports
Type Error invalid URL string
1 replies