feat(auth): add optional authentication guard and extend AuthModule providers
Introduce `OptionalAuthGuard` to allow conditional authentication for routes. Update `AuthModule` to include `AuthGuard`, `OptionalAuthGuard`, and `RolesGuard` in providers and exports for broader reuse. feat(app): integrate `AdminModule` into app module Add `AdminModule` to the app's main module to enable administration functionalities. feat(users): enhance user profiles with bio and avatar fields Extend `UpdateUserDto` to include optional `bio` and `avatarUrl` fields for better user customization. feat(categories): add functionality to count all categories Implement `countAll` method in `CategoriesRepository` to fetch the total number of categories using raw SQL counting.
This commit is contained in:
@@ -5,6 +5,9 @@ import { SessionsModule } from "../sessions/sessions.module";
|
||||
import { UsersModule } from "../users/users.module";
|
||||
import { AuthController } from "./auth.controller";
|
||||
import { AuthService } from "./auth.service";
|
||||
import { AuthGuard } from "./guards/auth.guard";
|
||||
import { OptionalAuthGuard } from "./guards/optional-auth.guard";
|
||||
import { RolesGuard } from "./guards/roles.guard";
|
||||
import { RbacService } from "./rbac.service";
|
||||
import { RbacRepository } from "./repositories/rbac.repository";
|
||||
|
||||
@@ -16,7 +19,21 @@ import { RbacRepository } from "./repositories/rbac.repository";
|
||||
DatabaseModule,
|
||||
],
|
||||
controllers: [AuthController],
|
||||
providers: [AuthService, RbacService, RbacRepository],
|
||||
exports: [AuthService, RbacService, RbacRepository],
|
||||
providers: [
|
||||
AuthService,
|
||||
RbacService,
|
||||
RbacRepository,
|
||||
AuthGuard,
|
||||
OptionalAuthGuard,
|
||||
RolesGuard,
|
||||
],
|
||||
exports: [
|
||||
AuthService,
|
||||
RbacService,
|
||||
RbacRepository,
|
||||
AuthGuard,
|
||||
OptionalAuthGuard,
|
||||
RolesGuard,
|
||||
],
|
||||
})
|
||||
export class AuthModule {}
|
||||
|
||||
Reference in New Issue
Block a user