| Conditions | 2 |
| Total Lines | 14 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { Request } from 'express'; |
||
| 8 | |||
| 9 | public canActivate(context: ExecutionContext): boolean { |
||
| 10 | const configuredCalendarSecret = this.configService.get<string>( |
||
| 11 | 'CALENDAR_SECRET' |
||
| 12 | ); |
||
| 13 | |||
| 14 | if (!configuredCalendarSecret) { |
||
| 15 | return false; |
||
| 16 | } |
||
| 17 | |||
| 18 | const request: Request = context.switchToHttp().getRequest(); |
||
| 19 | const { calendar_secret } = request.query; |
||
| 20 | |||
| 21 | return configuredCalendarSecret === calendar_secret; |
||
| 22 | } |
||
| 24 |