feat(auth): implement user authentication with JWT and NextAuth
- Added user registration and login functionality with JWT authentication. - Created auth controller, service, and module in the backend. - Implemented user model and user products management. - Integrated NextAuth for session management on the frontend. - Added middleware for protecting routes and handling public access. - Updated frontend API routes to include authorization headers. - Enhanced recipe and user product models to support ownership and visibility. - Created registration and login pages in the frontend. - Added necessary types for NextAuth session management.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { HealthModule } from './health/health.module';
|
||||
import { PrismaModule } from './prisma/prisma.module';
|
||||
import { ProductsModule } from './products/products.module';
|
||||
@@ -9,6 +10,10 @@ import { PantryModule } from './pantry/pantry.module';
|
||||
import { MealPlanModule } from './meal-plan/meal-plan.module';
|
||||
import { ReceiptImportModule } from './receipt-import/receipt-import.module';
|
||||
import { ReceiptAliasModule } from './receipt-alias/receipt-alias.module';
|
||||
import { AuthModule } from './auth/auth.module';
|
||||
import { UsersModule } from './users/users.module';
|
||||
import { UserProductsModule } from './user-products/user-products.module';
|
||||
import { JwtAuthGuard } from './auth/jwt-auth.guard';
|
||||
|
||||
|
||||
@Module({
|
||||
@@ -23,6 +28,15 @@ import { ReceiptAliasModule } from './receipt-alias/receipt-alias.module';
|
||||
MealPlanModule,
|
||||
ReceiptImportModule,
|
||||
ReceiptAliasModule,
|
||||
AuthModule,
|
||||
UsersModule,
|
||||
UserProductsModule,
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: APP_GUARD,
|
||||
useClass: JwtAuthGuard,
|
||||
},
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
Reference in New Issue
Block a user