simplify to always use email from cfIdentity
Signed-off-by: Tyler Davis <tylerd@canva.com>
This commit is contained in:
@@ -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',
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user