(headers: Headers)
| 41 | }; |
| 42 | |
| 43 | const bearerToken = (headers: Headers): string | undefined => { |
| 44 | const authorization = headers.get("authorization"); |
| 45 | if (!authorization) return undefined; |
| 46 | return authorization.toLowerCase().startsWith("bearer ") |
| 47 | ? authorization.slice(7).trim() || undefined |
| 48 | : undefined; |
| 49 | }; |
| 50 | |
| 51 | // The OAuth provider callback is hit by the user's external browser, which |
| 52 | // can't carry our bearer — the OAuth `state` (validated downstream by |
no test coverage detected