Skip to content

Commit

Permalink
fix endpoint permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan Garifullin committed May 13, 2021
1 parent 1208ed6 commit 12f606c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "git"
},
"scripts": {
"build:server": "cd server/; npm run build",
"proxy": "sudo nginx -p $PWD/proxy -c nginx.conf",
"proxy:dev": "sudo nginx -p $PWD/proxy -c nginx.dev.conf",
"start:server": "node dist/main",
Expand Down
3 changes: 1 addition & 2 deletions server/src/admin/admin.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { LoggerModule } from 'logger/logger.module';
import { AdminController } from './admin.controller';
import { AdminService } from './admin.service';

@Module({
controllers: [AdminController],
providers: [AdminService],
providers: [],
imports: [LoggerModule, TypeOrmModule.forFeature([Report, User, CalendarEvent, PendingEvent, Report, ChatMessage, File])],
})
export class AdminModule { }
4 changes: 0 additions & 4 deletions server/src/admin/admin.service.ts

This file was deleted.

4 changes: 2 additions & 2 deletions server/src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { generateId } from 'utils/IdGenerator';
import { LocalAuthGuard } from '../guards/local.guard';
import { UsersService } from '../users/users.service';
import { AuthService } from './auth.service';
import { VerifyService } from './mail.service';
import { MailService } from './mail.service';

@ApiTags('Авторизация и регистрация пользователей')
@Controller('/api/auth')
Expand All @@ -43,7 +43,7 @@ export class AuthController {
private auth: AuthService,
private i18n: I18nService,
private users: UsersService,
private verifyMail: VerifyService,
private verifyMail: MailService,
private jwt: JwtService,
private adapter: UserAdapter
) { }
Expand Down
4 changes: 2 additions & 2 deletions server/src/auth/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';
import { JwtStrategy } from './jwt.strategy';
import { LocalStrategy } from './local.strategy';
import { VerifyService } from './mail.service'
import { MailService } from './mail.service'

@Module({
controllers: [AuthController],
Expand All @@ -23,6 +23,6 @@ import { VerifyService } from './mail.service'
UsersModule,
],
exports: [JwtModule],
providers: [AuthService, JwtStrategy, LocalStrategy, VerifyService],
providers: [AuthService, JwtStrategy, LocalStrategy, MailService],
})
export class AuthModule { }
2 changes: 1 addition & 1 deletion server/src/auth/mail.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { MailerService } from '@nestjs-modules/mailer';
import { Inject, Injectable, LoggerService } from '@nestjs/common';

@Injectable()
export class VerifyService {
export class MailService {
constructor(
@Inject('Logger')
private logger: LoggerService,
Expand Down
2 changes: 1 addition & 1 deletion server/src/schedules/schedules.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class SchedulesController {
}

@Types(UserType.ADMIN, UserType.MODERATOR, UserType.LAWYER)
@UseGuards(JwtAuthGuard)
@UseGuards(JwtAuthGuard, UserGuard)
@ApiBearerAuth()
@Get("/")
@ApiOperation({
Expand Down

0 comments on commit 12f606c

Please sign in to comment.