diff --git a/docs/docs/migration/migration-from-v7-to-v8.md b/docs/docs/migration/migration-from-v7-to-v8.md index c71b07f9e1..2662b0b40e 100644 --- a/docs/docs/migration/migration-from-v7-to-v8.md +++ b/docs/docs/migration/migration-from-v7-to-v8.md @@ -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: @@ -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