Fix more build errors

This commit is contained in:
Darren Clarke 2023-03-15 12:17:43 +00:00
parent 1bdc1e60db
commit 30ce47826f
61 changed files with 1161 additions and 541 deletions

View file

@ -1,11 +1,11 @@
import { promisify } from "util";
import { promisify } from "node:util";
import jwt from "jsonwebtoken";
import jwksClient from "jwks-rsa";
import * as Boom from "@hapi/boom";
import * as Wreck from "@hapi/wreck";
import Providers from "next-auth/providers";
import Credentials from "next-auth/providers/credentials";
import type { Adapter } from "next-auth/adapters";
import type { IncomingMessage } from "http";
import type { IncomingMessage } from "node:http";
const CF_JWT_HEADER_NAME = "cf-access-jwt-assertion";
const CF_JWT_ALGOS = ["RS256"];
@ -30,7 +30,7 @@ export const cfVerifier = (audience: string, domain: string): VerifyFn => {
return async (token) => {
const getKey = (header: any, callback: any) => {
client.getSigningKey(header.kid, function (err: any, key: any) {
client.getSigningKey(header.kid, (err: any, key: any) => {
if (err)
throw Boom.serverUnavailable(
"failed to fetch cloudflare access jwks"
@ -201,8 +201,8 @@ export const CloudflareAccessProvider = (
req: IncomingMessage
) => {
const verifier = cfVerifier(audience, domain);
// @ts-expect-error
return Providers.Credentials({
return Credentials({
id: cloudflareAccountProvider,
name: "Cloudflare Access",
credentials: {},