diff --git a/plugins/auth-backend-module-cloudflare-access-provider/src/authenticator.test.ts b/plugins/auth-backend-module-cloudflare-access-provider/src/authenticator.test.ts index 69fcb742e5..ea38bd5180 100644 --- a/plugins/auth-backend-module-cloudflare-access-provider/src/authenticator.test.ts +++ b/plugins/auth-backend-module-cloudflare-access-provider/src/authenticator.test.ts @@ -25,7 +25,7 @@ describe('authenticator', () => { const profile = await auth.defaultProfileTransform( { - cfIdentity: { name: 'Name' } as any, + cfIdentity: { name: 'Name', email: 'hello@example.com' } as any, claims: { email: 'hello@example.com' } as any, token: 'fake', }, diff --git a/plugins/auth-backend-module-cloudflare-access-provider/src/authenticator.ts b/plugins/auth-backend-module-cloudflare-access-provider/src/authenticator.ts index 632c439d7e..7b311a60f0 100644 --- a/plugins/auth-backend-module-cloudflare-access-provider/src/authenticator.ts +++ b/plugins/auth-backend-module-cloudflare-access-provider/src/authenticator.ts @@ -38,7 +38,7 @@ export function createCloudflareAccessAuthenticator(options?: { async defaultProfileTransform(result: CloudflareAccessResult) { return { profile: { - email: result.claims.email ?? result.cfIdentity.email, + email: result.cfIdentity.email, displayName: result.cfIdentity.name, }, };