77 */
88namespace OCA \Files_Sharing \Controller ;
99
10- use OC \Security \CSP \ContentSecurityPolicy ;
1110use OCA \DAV \Connector \Sabre \PublicAuth ;
1211use OCA \FederatedFileSharing \FederatedShareProvider ;
1312use OCA \Files_Sharing \Event \BeforeTemplateRenderedEvent ;
@@ -92,15 +91,7 @@ public function showAuthenticate(): TemplateResponse {
9291
9392 $ this ->eventDispatcher ->dispatchTyped (new BeforeTemplateRenderedEvent ($ this ->share , BeforeTemplateRenderedEvent::SCOPE_PUBLIC_SHARE_AUTH ));
9493
95- $ response = new TemplateResponse ('core ' , 'publicshareauth ' , $ templateParameters , 'guest ' );
96- if ($ this ->share ->getSendPasswordByTalk ()) {
97- $ csp = new ContentSecurityPolicy ();
98- $ csp ->addAllowedConnectDomain ('* ' );
99- $ csp ->addAllowedMediaDomain ('blob: ' );
100- $ response ->setContentSecurityPolicy ($ csp );
101- }
102-
103- return $ response ;
94+ return new TemplateResponse ('core ' , 'publicshareauth ' , $ templateParameters , 'guest ' );
10495 }
10596
10697 /**
@@ -111,15 +102,7 @@ protected function showAuthFailed(): TemplateResponse {
111102
112103 $ this ->eventDispatcher ->dispatchTyped (new BeforeTemplateRenderedEvent ($ this ->share , BeforeTemplateRenderedEvent::SCOPE_PUBLIC_SHARE_AUTH ));
113104
114- $ response = new TemplateResponse ('core ' , 'publicshareauth ' , $ templateParameters , 'guest ' );
115- if ($ this ->share ->getSendPasswordByTalk ()) {
116- $ csp = new ContentSecurityPolicy ();
117- $ csp ->addAllowedConnectDomain ('* ' );
118- $ csp ->addAllowedMediaDomain ('blob: ' );
119- $ response ->setContentSecurityPolicy ($ csp );
120- }
121-
122- return $ response ;
105+ return new TemplateResponse ('core ' , 'publicshareauth ' , $ templateParameters , 'guest ' );
123106 }
124107
125108 /**
@@ -130,15 +113,7 @@ protected function showIdentificationResult(bool $success = false): TemplateResp
130113
131114 $ this ->eventDispatcher ->dispatchTyped (new BeforeTemplateRenderedEvent ($ this ->share , BeforeTemplateRenderedEvent::SCOPE_PUBLIC_SHARE_AUTH ));
132115
133- $ response = new TemplateResponse ('core ' , 'publicshareauth ' , $ templateParameters , 'guest ' );
134- if ($ this ->share ->getSendPasswordByTalk ()) {
135- $ csp = new ContentSecurityPolicy ();
136- $ csp ->addAllowedConnectDomain ('* ' );
137- $ csp ->addAllowedMediaDomain ('blob: ' );
138- $ response ->setContentSecurityPolicy ($ csp );
139- }
140-
141- return $ response ;
116+ return new TemplateResponse ('core ' , 'publicshareauth ' , $ templateParameters , 'guest ' );
142117 }
143118
144119 /**
0 commit comments