@@ -3,33 +3,20 @@ import * as path from 'path'
33
44import { Paths } from 'claim/paths'
55
6- import { AuthorizationMiddleware } from 'idam/authorizationMiddleware'
76import { ClaimEligibilityGuard } from 'claim/guards/claimEligibilityGuard'
87import { RouterFinder } from 'shared/router/routerFinder'
98import { DraftMiddleware } from '@hmcts/cmc-draft-store-middleware'
109import { DraftService } from 'services/draftService'
1110import { DraftClaim } from 'drafts/models/draftClaim'
12- import { OAuthHelper } from 'idam/oAuthHelper'
13-
14- function claimIssueRequestHandler ( ) : express . RequestHandler {
15- function accessDeniedCallback ( req : express . Request , res : express . Response ) : void {
16- res . redirect ( OAuthHelper . forLogin ( req , res ) )
17- }
18-
19- const requiredRoles = [
20- 'citizen'
21- ]
22- const unprotectedPaths = [ ]
23- return AuthorizationMiddleware . requestHandler ( requiredRoles , accessDeniedCallback , unprotectedPaths )
24- }
11+ // import { claimIssueRequestHandler } from 'claim-documents/index'
2512
2613export class Feature {
2714 enableFor ( app : express . Express ) {
2815 if ( app . settings . nunjucksEnv && app . settings . nunjucksEnv . globals ) {
2916 app . settings . nunjucksEnv . globals . ClaimPaths = Paths
3017 }
31-
32- app . all ( '/claim/*' , claimIssueRequestHandler ( ) )
18+ // commented out as claim document index.ts will handle this
19+ // app.all('/claim/*', claimIssueRequestHandler())
3320 app . all ( / ^ \/ c l a i m \/ (? ! s t a r t | a m o u n t - e x c e e d e d | n e w - f e a t u r e s - c o n s e n t | .+ \/ c o n f i r m a t i o n | .+ \/ r e c e i p t | .+ \/ d r a f t R e c e i p t | .+ \/ s e a l e d - c l a i m ) .* $ / ,
3421 DraftMiddleware . requestHandler ( new DraftService ( ) , 'claim' , 100 , ( value : any ) : DraftClaim => {
3522 return new DraftClaim ( ) . deserialize ( value )
0 commit comments