soufianeelc
soufianeelc
HHono
Created by soufianeelc on 5/16/2024 in #help
What data should be sent from the client to use clerk middleware?
I'm working on a react-native app using expo. The back-end is built using nodejs & hono. I'm using clerk middleware to handle auth. What data should be sent from the client to authenticate requests(tokens, ids...) ?
2 replies
HHono
Created by soufianeelc on 5/9/2024 in #help
Error: Missing Clerk Secret key
I'm using clerk with hono middleware to handle auth: https://clerk.com/changelog/2023-11-08 The code is really simple: import { clerkMiddleware, getAuth } from "@hono/clerk-auth"; import { serve } from "@hono/node-server"; import { Hono } from "hono"; const app = new Hono(); app.use(clerkMiddleware()); app.get("/", (c) => { try { const auth = getAuth(c); if (!auth?.userId) { return c.json({ message: "You are not logged in.", }); } return c.json({ message: "You are logged in!", userId: auth.userId, }); } catch (err) { return c.json({ message: JSON.stringify(err), }); } }); const port = 3000; console.log(Server is running on port ${port}); serve({ fetch: app.fetch, port, }); .env file CLERK_SECRET_KEY= CLERK_PUBLISHABLE_KEY= DATABASE_URL= I'm getting this error: Server is running on port 3000 Error: Missing Clerk Secret key at C:\Users\840 G5\Desktop\projects\pfe\web-service\node_modules\@hono\clerk-auth\dist\index.cjs:42:13 at dispatch (C:\Users\840 G5\Desktop\projects\pfe\web-service\node_modules\hono\dist\cjs\compose.js:51:23) at C:\Users\840 G5\Desktop\projects\pfe\web-service\node_modules\hono\dist\cjs\compose.js:28:12 at C:\Users\840 G5\Desktop\projects\pfe\web-service\node_modules\hono\dist\cjs\hono-base.js:211:31 at Hono.dispatch (C:\Users\840 G5\Desktop\projects\pfe\web-service\node_modules\hono\dist\cjs\hono-base.js:221:7) at fetch (C:\Users\840 G5\Desktop\projects\pfe\web-service\node_modules\hono\dist\cjs\hono-base.js:224:17) at Server.<anonymous> (C:\Users\840 G5\Desktop\projects\pfe\web-service\node_modules\@hono\node-server\dist\index.js:430:13) at Server.emit (node:events:518:28) at Server.emit (node:domain:488:12) at parserOnIncoming (node:_http_server:1151:12)
3 replies