This commit is contained in:
Rudra deep Biswas 2025-05-06 16:38:13 +05:30
parent 7e52b6178c
commit 12f09f80d8
2 changed files with 10 additions and 11 deletions

View file

@ -9,18 +9,18 @@ export class ExternalApiSecurityGuard implements CanActivate {
const request = context.switchToHttp().getRequest(); const request = context.switchToHttp().getRequest();
// // Check if external API is enabled // // Check if external API is enabled
// const isExternalApiEnabled = this.configService.get<string>('ENABLE_EXTERNAL_API') === 'true'; const isExternalApiEnabled = this.configService.get<string>('ENABLE_EXTERNAL_API') === 'true';
// if (!isExternalApiEnabled) { if (!isExternalApiEnabled) {
// throw new ForbiddenException('External API is disabled'); throw new ForbiddenException('External API is disabled');
// } }
// // // Check the authorization header // // Check the authorization header
// const authHeader = request.headers['authorization']; const authHeader = request.headers['authorization'];
// const externalApiAccessToken = this.configService.get<string>('EXTERNAL_API_ACCESS_TOKEN'); const externalApiAccessToken = this.configService.get<string>('EXTERNAL_API_ACCESS_TOKEN');
// if (!authHeader || authHeader !== `Basic ${externalApiAccessToken}`) { if (!authHeader || authHeader !== `Basic ${externalApiAccessToken}`) {
// throw new ForbiddenException('Unauthorized'); throw new ForbiddenException('Unauthorized');
// } }
return true; return true;
} }