chore: fix protectRoles in auth example

This commit is contained in:
Jarrod Flesch
2023-07-12 08:31:21 -04:00
parent 70f3e6fc3e
commit 59bc002aed

View File

@@ -10,8 +10,7 @@ export const protectRoles: FieldHook<User & { id: string }> = async ({ req, data
return ['user'] return ['user']
} }
const userRoles = new Set(...(data?.roles || [])) const userRoles = new Set(data?.roles || [])
userRoles.add('user') userRoles.add('user')
return [...userRoles] return [...userRoles]
} }