(error: string, description: string, scopes?: ReadonlyArray<string>)
| 5 | import { createRemoteJWKSet, jwtVerify } from "jose" |
| 6 | |
| 7 | const getHeaders = (error: string, description: string, scopes?: ReadonlyArray<string>) => ({ |
| 8 | "WWW-Authenticate": `Bearer realm="api", error="${error}", error_description="${description.replace(/"/g, "'")}"${ |
| 9 | scopes ? `, scope="${scopes.join(" ")}"` : "" |
| 10 | }` |
| 11 | }) |
| 12 | |
| 13 | export class UnauthorizedError extends Error { |
| 14 | readonly status: number = 401 |
no test coverage detected
searching dependent graphs…