mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +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();
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue