File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
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,12 @@ 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 ( createClaimDTO , true ) ;
206207
207208 return {
208209 title : claim . title ,
@@ -245,11 +246,14 @@ export class ClaimController {
245246 }
246247 }
247248
248- private async _createClaim ( createClaimDTO ) {
249+ private async _createClaim (
250+ createClaimDTO ,
251+ overrideCaptchaValidation = false
252+ ) {
249253 const validateCaptcha = await this . captchaService . validate (
250254 createClaimDTO . recaptcha
251255 ) ;
252- if ( ! validateCaptcha ) {
256+ if ( ! validateCaptcha && ! overrideCaptchaValidation ) {
253257 throw new Error ( "Error validating captcha" ) ;
254258 }
255259 return this . claimService . create ( createClaimDTO ) ;
You can’t perform that action at this time.
0 commit comments