Skip to content
Snippets Groups Projects
Commit 0b7b05b9 authored by Chiquita Ahsanunnisa's avatar Chiquita Ahsanunnisa
Browse files

Merge branch 'task/secure-endpoint' into 'development'

task/secure-endpoint

See merge request !29
parents a5ac4ce7 94ec4705
......@@ -83,8 +83,11 @@ export class AkunController {
return this.akunService.findById(param.id);
}
// TODO: protect/secure this endpoint
@ApiCookieAuth()
@ApiBearerAuth()
@ApiOkResponse({ type: IdDto })
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(RoleEnum.ADMIN, RoleEnum.S1_TIM_TA, RoleEnum.S2_TIM_TESIS)
@Put("/")
createOrUpdateAccount(@Body() createAkunDto: CreateAkunDto) {
return this.akunService.createOrUpdateAccount(createAkunDto);
......
......@@ -21,7 +21,7 @@ const defaultOptions: TypeOrmModuleOptions = {
imports: [
ConfigModule.forRoot({
validate,
/* WARNING: allowUnknown is set to true, but please only use
/* WARNING: allowUnknown is set to true, but please only use
environment variables defined in env.validation.ts */
validationOptions: { abortEarly: true, allowUnknown: true },
}),
......@@ -32,7 +32,7 @@ const defaultOptions: TypeOrmModuleOptions = {
username: process.env.S1_POSTGRES_USER,
password: process.env.S1_POSTGRES_PASSWORD,
database: process.env.S1_POSTGRES_DATABASE,
synchronize: true,
// synchronize: true,
name: "S1Connection",
}),
TypeOrmModule.forRoot({
......@@ -42,7 +42,7 @@ const defaultOptions: TypeOrmModuleOptions = {
username: process.env.S2_POSTGRES_USER,
password: process.env.S2_POSTGRES_PASSWORD,
database: process.env.S2_POSTGRES_DATABASE,
synchronize: true,
// synchronize: true,
name: "S2Connection",
}),
AkunModule,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment