Skip to content

Commit

Permalink
Add note to migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxachun committed Dec 19, 2024
1 parent a39e806 commit 7b66355
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/docs/migration/migration-from-v7-to-v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,20 @@ npx @comet/upgrade v8/remove-passport.ts

:::

Wrap the strategies in `...createAuthGuardProviders()`:
Rename the `strategy`-factories and wrap them in `...createAuthGuardProviders()`:

```diff title=api/src/auth/auth.module.ts
- createStaticCredentialsBasicStrategy({ ... }),
- createAuthProxyJwtStrategy({ ... }),
- createStaticCredentialsBasicStrategy({ ... }),
+ ...createAuthGuardProviders(
+ createStaticCredentialsBasicStrategy({ ... }),
+ createAuthProxyJwtStrategy({ ... }),
+ createBasicAuthService({ ... }),
+ createJwtAuthService({ ... }),
+ createStaticUserAuthService({ ... }),
+ ),
```

:::note The configuration of the strategies may have changed slightly. Consulting the code completion should help to adapt.
:::note The configuration of the AuthServices have changed slightly. Consulting the code completion should help to adapt.

Replace `createAuthResolver` with the class name:

Expand All @@ -170,6 +172,8 @@ Replace `createAuthResolver` with the class name:
+ useClass: CometAuthGuard,
```

:::note `CometAuthGuard` does not support Passport strategies anymore. Consider rewriting or wrapping into `AuthServiceInterface`. However, you still can use passport strategies in conjunction with the provided `AuthGuard` from `@nestjs/passport`.

Import `JwtModule` from `@nestjs/jwt`:

```diff title=api/src/auth/auth.module.ts
Expand Down

0 comments on commit 7b66355

Please sign in to comment.