You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/src/docs/hotchocolate/v16/migrating/migrate-from-15-to-16.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,24 @@ The `@skip` and `@include` directives are now disallowed on root subscription fi
20
20
21
21
Deprecating a field now requires the implemented field in the interface to also be deprecated, as specified in the [draft specification](https://spec.graphql.org/draft/#sec-Objects.Type-Validation).
22
22
23
+
## Accidental use of `Microsoft.AspNetCore.Authorization.*` attributes throws an error
24
+
25
+
Since our authorization attributes (`[Authorize]` and `[AllowAnonymous]`) share the same names as the regular ASP.NET attributes, it's easy to accidentally use the wrong ones.
26
+
In the worst-case scenario, this could result in your field or type ending up without any authorization being applied!
27
+
28
+
To prevent this, we've added a check that throws an error during schema generation if it detects `Microsoft.AspNetCore.Authorization.*` attributes being applied to a GraphQL resolver.
29
+
30
+
> Note: Keep in mind that your clients might currently rely on the absence of authorization.
31
+
32
+
You can disable this new validation by setting the `ErrorOnAspNetCoreAuthorizationAttributes` option to `false`:
0 commit comments