11using System ;
22using System . IO ;
3+ using System . Net ;
34using System . Threading . Tasks ;
45using eFormAPI . Web . Abstractions ;
56using eFormAPI . Web . Abstractions . Security ;
67using eFormAPI . Web . Infrastructure ;
78using ICSharpCode . SharpZipLib . Zip ;
9+ using Microsoft . AspNetCore . Authentication . Cookies ;
810using Microsoft . AspNetCore . Authorization ;
911using Microsoft . AspNetCore . Http ;
1012using Microsoft . AspNetCore . Mvc ;
@@ -34,7 +36,8 @@ public TemplateFilesController(IEFormCoreService coreHelper,
3436 [ HttpGet ]
3537 [ Authorize ]
3638 [ Route ( "api/template-files/csv/{id}" ) ]
37- [ Authorize ( Policy = AuthConsts . EformPolicies . Eforms . GetCsv ) ]
39+ [ Authorize ( AuthenticationSchemes = CookieAuthenticationDefaults . AuthenticationScheme ,
40+ Policy = AuthConsts . EformPolicies . Eforms . GetCsv ) ]
3841 public async Task < IActionResult > Csv ( int id )
3942 {
4043 if ( ! await _permissionsService . CheckEform ( id ,
@@ -54,7 +57,8 @@ public async Task<IActionResult> Csv(int id)
5457
5558 [ HttpGet ]
5659 [ Route ( "api/template-files/get-image/{fileName}.{ext}" ) ]
57- [ Authorize ( Policy = AuthConsts . EformPolicies . Cases . CasesRead ) ]
60+ [ Authorize ( AuthenticationSchemes = CookieAuthenticationDefaults . AuthenticationScheme ,
61+ Policy = AuthConsts . EformPolicies . Cases . CasesRead ) ]
5862 public IActionResult GetImage ( string fileName , string ext , string noCache = "noCache" )
5963 {
6064 var core = _coreHelper . GetCore ( ) ;
@@ -147,7 +151,8 @@ public IActionResult GetPdfFile(string fileName)
147151 [ HttpGet ]
148152 [ Authorize ]
149153 [ Route ( "api/template-files/download-case-pdf/{templateId}" ) ]
150- [ Authorize ( Policy = AuthConsts . EformPolicies . Cases . CaseGetPdf ) ]
154+ [ Authorize ( AuthenticationSchemes = CookieAuthenticationDefaults . AuthenticationScheme ,
155+ Policy = AuthConsts . EformPolicies . Cases . CaseGetPdf ) ]
151156 public async Task < IActionResult > DownloadEFormPdf ( int templateId , int caseId )
152157 {
153158 if ( ! await _permissionsService . CheckEform ( templateId ,
@@ -180,7 +185,8 @@ public async Task<IActionResult> DownloadEFormPdf(int templateId, int caseId)
180185 [ HttpGet ]
181186 [ Authorize ]
182187 [ Route ( "api/template-files/download-eform-xml/{templateId}" ) ]
183- [ Authorize ( Policy = AuthConsts . EformPolicies . Eforms . DownloadXml ) ]
188+ [ Authorize ( AuthenticationSchemes = CookieAuthenticationDefaults . AuthenticationScheme ,
189+ Policy = AuthConsts . EformPolicies . Eforms . DownloadXml ) ]
184190 public async Task < IActionResult > DownloadEFormXml ( int templateId )
185191 {
186192 if ( ! await _permissionsService . CheckEform ( templateId ,
@@ -212,7 +218,8 @@ public async Task<IActionResult> DownloadEFormXml(int templateId)
212218 [ HttpPost ]
213219 [ Authorize ]
214220 [ Route ( "api/template-files/upload-eform-zip" ) ]
215- [ Authorize ( Policy = AuthConsts . EformPolicies . Eforms . UploadZip ) ]
221+ [ Authorize ( AuthenticationSchemes = CookieAuthenticationDefaults . AuthenticationScheme ,
222+ Policy = AuthConsts . EformPolicies . Eforms . UploadZip ) ]
216223 public async Task < IActionResult > UploadEformZip ( EformZipUploadModel uploadModel )
217224 {
218225 if ( ! await _permissionsService . CheckEform ( uploadModel . TemplateId ,
0 commit comments