Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/shared/guards/gitea-webhook-auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class GiteaWebhookAuthGuard implements CanActivate {
throw new BadRequestException('Missing authorization header');
}

if (authHeader !== `Bearer ${auth}`) {
if (authHeader !== `SecretKey ${auth}`) {
this.logger.error('Invalid authorization header');
throw new ForbiddenException('Invalid authorization');
}
Expand Down
6 changes: 5 additions & 1 deletion src/shared/request/tokenRequestValidator.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export class TokenValidatorMiddleware implements NestMiddleware {

const [type, idToken] = request.headers.authorization.split(' ') ?? [];

if (type !== 'Bearer' || !idToken) {
if (type !== 'Bearer') {
return next();
}

if (!idToken) {
throw new UnauthorizedException('Invalid or missing JWT!');
}

Expand Down