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: content/recipes/passport.md
+17-18Lines changed: 17 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -943,8 +943,7 @@ Then, you refer to this via a decorator like `@UseGuards(AuthGuard('myjwt'))`.
943
943
944
944
#### GraphQL
945
945
946
-
In order to use an AuthGuard with [GraphQL](https://docs.nestjs.com/graphql/quick-start), extend the built-in AuthGuard class and override the getRequest() method.
947
-
In the case of passport-local strategy you will also have to attach the GraphQL context's arguments into the request's body so that Passport can use them for validation.
946
+
In order to use an AuthGuard with [GraphQL](https://docs.nestjs.com/graphql/quick-start), extend the built-in `AuthGuard` class and override the `getRequest()` method.
948
947
949
948
```typescript
950
949
@Injectable()
@@ -956,22 +955,6 @@ export class GqlAuthGuard extends AuthGuard('jwt') {
956
955
}
957
956
```
958
957
959
-
In the case of passport-local strategy you will also have to attach the GraphQL context's arguments into the request's body so that Passport can access them for validation (if not done so an Unauthorized error gets issued).
For the passport-local strategy, you'll also need to add the GraphQL context's arguments to the request body so Passport can access them for validation. Otherwise, you'll get an Unauthorized error.
0 commit comments