Skip to content

Commit

Permalink
fix authentication guards and modules
Browse files Browse the repository at this point in the history
  • Loading branch information
belhajManel committed Apr 30, 2024
1 parent bd8decb commit ed994c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
3 changes: 3 additions & 0 deletions back/frankme/src/links/links.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Patch,
Param,
Delete,
UseGuards,
} from '@nestjs/common';
import { LinksService } from './links.service';
import { CreateLinkDto } from './dto/create-link.dto';
Expand All @@ -14,7 +15,9 @@ import { ActiveUser } from 'src/iam/authentication/decorators/active-user.decora
import { AuthType } from 'src/iam/authentication/enums/auth-type.enum';
import { Auth } from 'src/iam/authentication/decorators/auth.decorator';
import { ActiveUserData } from 'src/iam/interfaces/active-user-data.interface';
import { AccessTokenGuard } from 'src/iam/authentication/guards/access-token.guard';

@UseGuards(AccessTokenGuard)
@Auth(AuthType.Bearer)
@Controller('links')
export class LinksController {
Expand Down
11 changes: 1 addition & 10 deletions back/frankme/src/links/links.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { Link } from './entities/link.entity';
import { ConfigModule } from '@nestjs/config';
import { JwtModule } from '@nestjs/jwt';
import jwtConfig from 'src/iam/config/jwt.config';
import { APP_GUARD } from '@nestjs/core';
import { AccessTokenGuard } from 'src/iam/authentication/guards/access-token.guard';
import { UsersService } from 'src/users/users.service';
import { User } from 'src/users/entities/user.entity';

Expand All @@ -18,13 +16,6 @@ import { User } from 'src/users/entities/user.entity';
ConfigModule.forFeature(jwtConfig),
],
controllers: [LinksController],
providers: [
LinksService,
UsersService,
{
provide: APP_GUARD,
useClass: AccessTokenGuard,
},
],
providers: [LinksService, UsersService],
})
export class LinksModule {}
8 changes: 4 additions & 4 deletions back/frankme/src/users/users.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import { APP_GUARD } from '@nestjs/core';
controllers: [UsersController],
providers: [
UsersService,
{
provide: APP_GUARD,
useClass: AccessTokenGuard,
},
// {
// provide: APP_GUARD,
// useClass: AccessTokenGuard,
// },
],
exports: [UsersService],
})
Expand Down

0 comments on commit ed994c5

Please sign in to comment.