File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ export class SessionGuard implements CanActivate {
103103 "/api/health" ,
104104 "/sign-up" ,
105105 "/api/user/register" ,
106+ "/api/claim" , // Allow this route to be public temporarily for testing
106107 ] . some ( ( route ) => request . url . startsWith ( route ) ) ;
107108
108109 const overridePublicRoutes =
Original file line number Diff line number Diff line change @@ -198,11 +198,15 @@ export class ClaimController {
198198 }
199199 }
200200
201+ @IsPublic ( ) // Allow this route to be public temporarily for testing
201202 @ApiTags ( "claim" )
202203 @Post ( "api/claim/unattributed" )
203204 async createUnattributedClaim ( @Body ( ) createClaimDTO ) {
204205 try {
205- const claim = await this . _createClaim ( createClaimDTO ) ;
206+ const claim = await this . _createClaim ( {
207+ overrideCaptchaValidation : true ,
208+ ...createClaimDTO ,
209+ } ) ;
206210
207211 return {
208212 title : claim . title ,
@@ -246,10 +250,11 @@ export class ClaimController {
246250 }
247251
248252 private async _createClaim ( createClaimDTO ) {
253+ const { overrideCaptchaValidation = false } = createClaimDTO ;
249254 const validateCaptcha = await this . captchaService . validate (
250255 createClaimDTO . recaptcha
251256 ) ;
252- if ( ! validateCaptcha ) {
257+ if ( ! validateCaptcha && ! overrideCaptchaValidation ) {
253258 throw new Error ( "Error validating captcha" ) ;
254259 }
255260 return this . claimService . create ( createClaimDTO ) ;
You can’t perform that action at this time.
0 commit comments