MCPcopy Create free account
hub / github.com/acoyfellow/UserDO / decodeJWT

Function decodeJWT

src/authMiddleware.ts:23–28  ·  view source on GitHub ↗
(jwt: string)

Source from the content-addressed store, hash-verified

21 if (token || refreshToken) {
22 try {
23 const decodeJWT = (jwt: string) => {
24 try {
25 const parts = jwt.split('.')
26 return parts.length === 3 ? JSON.parse(atob(parts[1])) : null
27 } catch { return null }
28 }
29
30 const email =
31 decodeJWT(token)?.email?.toLowerCase() ||

Callers 1

createAuthMiddlewareFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected