Skip to content

Commit 59bc002

Browse files
committed
chore: fix protectRoles in auth example
1 parent 70f3e6f commit 59bc002

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/auth/cms/src/collections/hooks/protectRoles.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ export const protectRoles: FieldHook<User & { id: string }> = async ({ req, data
1010
return ['user']
1111
}
1212

13-
const userRoles = new Set(...(data?.roles || []))
13+
const userRoles = new Set(data?.roles || [])
1414
userRoles.add('user')
15-
1615
return [...userRoles]
1716
}

0 commit comments

Comments
 (0)