mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-22 08:28:35 +00:00
review
This commit is contained in:
parent
7e52b6178c
commit
12f09f80d8
2 changed files with 10 additions and 11 deletions
|
|
@ -1 +0,0 @@
|
|||
//to do ? idk
|
||||
|
|
@ -9,18 +9,18 @@ export class ExternalApiSecurityGuard implements CanActivate {
|
|||
const request = context.switchToHttp().getRequest();
|
||||
|
||||
// // Check if external API is enabled
|
||||
// const isExternalApiEnabled = this.configService.get<string>('ENABLE_EXTERNAL_API') === 'true';
|
||||
// if (!isExternalApiEnabled) {
|
||||
// throw new ForbiddenException('External API is disabled');
|
||||
// }
|
||||
const isExternalApiEnabled = this.configService.get<string>('ENABLE_EXTERNAL_API') === 'true';
|
||||
if (!isExternalApiEnabled) {
|
||||
throw new ForbiddenException('External API is disabled');
|
||||
}
|
||||
|
||||
// // // Check the authorization header
|
||||
// const authHeader = request.headers['authorization'];
|
||||
// const externalApiAccessToken = this.configService.get<string>('EXTERNAL_API_ACCESS_TOKEN');
|
||||
// // Check the authorization header
|
||||
const authHeader = request.headers['authorization'];
|
||||
const externalApiAccessToken = this.configService.get<string>('EXTERNAL_API_ACCESS_TOKEN');
|
||||
|
||||
// if (!authHeader || authHeader !== `Basic ${externalApiAccessToken}`) {
|
||||
// throw new ForbiddenException('Unauthorized');
|
||||
// }
|
||||
if (!authHeader || authHeader !== `Basic ${externalApiAccessToken}`) {
|
||||
throw new ForbiddenException('Unauthorized');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue