MCPcopy Create free account
hub / github.com/effect-app/libs / checkJWTI

Function checkJWTI

packages/infra/src/internal/auth.ts:233–245  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

231 )
232
233export const checkJWTI = (config: Config) => {
234 const resolveConfig = makeResolveConfig(config)
235 const verify = verifyToken(resolveConfig)
236
237 return Effect.fnUntraced(function*(headers: HttpHeaders.Headers) {
238 const token = yield* getAuthorizationToken(headers, config.authRequired !== false)
239 if (Option.isNone(token)) {
240 return
241 }
242
243 yield* verify(token.value)
244 })
245}
246
247export const checkJwt = (config: Config) => {
248 const check = checkJWTI(config)

Callers 2

auth.test.tsFile · 0.85
checkJwtFunction · 0.85

Calls 3

makeResolveConfigFunction · 0.85
verifyTokenFunction · 0.85
getAuthorizationTokenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…