Skip to content

Commit

Permalink
Merge pull request #20 from Samarth-HP/develop
Browse files Browse the repository at this point in the history
Throttle config for DST
  • Loading branch information
radhay-samagra authored May 10, 2022
2 parents 35f6544 + b84474e commit 62be0bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/admin/admin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Injectable } from '@nestjs/common';
import { ResponseCode, ResponseStatus, UsersResponse } from './admin.interface';
import { FusionauthService } from './fusionauth/fusionauth.service';
import { v4 as uuidv4 } from 'uuid';
import { map } from 'rxjs';
import { catchError, map } from 'rxjs';

@Injectable()
export class AdminService {
Expand Down Expand Up @@ -63,6 +63,9 @@ export class AdminService {
'Content-Type': 'application/json'
}}).pipe(
map(response => response.status===200?{msg: "Password changed successfully"}:{msg:"Password cannot be changed"}),
catchError(e=>{
return e.data;
})
);
}

Expand All @@ -73,6 +76,9 @@ export class AdminService {
'Content-Type': 'application/json'
}}).pipe(
map(response => response.data),
catchError(e=>{
return e.data;
})
);
}

Expand All @@ -83,6 +89,9 @@ export class AdminService {
'Content-Type': 'application/json'
}}).pipe(
map(response => response.data),
catchError(e=>{
return e.data;
})
);
}
}
2 changes: 1 addition & 1 deletion src/dst/dst.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class DstController {
// return { resp };
// }

@Throttle(10, 86400)
@Throttle(parseInt(process.env.DST_API_LIMIT), parseInt(process.env.DST_API_TTL))
@Get('/:role/loginOrRegister')
async loginOrRegister(@Param('role') role: string, @Query('id') id, @Query('phone') phone, @Query('otp') otp, @Query('dob') dob): Promise<any> {
let resp: SignupResponse;
Expand Down

0 comments on commit 62be0bc

Please sign in to comment.