skip to Main Content

Reactjs – react's useState does not sets new state

I have the following frontend: AuthContext.js: const { createContext, useState, useContext } = require("react"); const AuthContext = createContext(); export function useAuth() { return useContext(AuthContext); } export function AuthProvider({ children }) { const [auth, setAuth] = useState(); return ( <AuthContext.Provider value={{…

VIEW QUESTION

Javascript – JWT verification with jose is failing

I have the following Next.js/Clerk.js middleware: import { authMiddleware } from "@clerk/nextjs"; import { jwtVerify } from "jose"; export default authMiddleware({ publicRoutes: ["/", "/contact", "/pricing", "/api/webhooks/user", "/api/reviews/add", "/api/user"], afterAuth (auth, req, evt) { const secret = new TextEncoder().encode (process.env.CLERK_PUBLIC_KEY) const…

VIEW QUESTION
Back To Top
Search