Fix registration with Talk iOS app

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2021-04-23 16:03:52 +02:00
parent d9e096a5ec
commit 99809a9d74
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 10 additions and 1 deletions

View File

@ -29,6 +29,7 @@ use OCA\Registration\Service\RegistrationService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\RedirectToDefaultAppResponse;
use OCP\AppFramework\Http\Response;
@ -264,7 +265,7 @@ class RegisterController extends Controller {
$this->eventDispatcher->dispatchTyped(new ShowFormEvent(ShowFormEvent::STEP_USER, $secret));
return new TemplateResponse('registration', 'form/user', [
$response = new TemplateResponse('registration', 'form/user', [
'email' => $registration->getEmail(),
'email_is_login' => $this->config->getAppValue('registration', 'email_is_login', 'no') === 'yes',
'loginname' => $loginname,
@ -278,6 +279,14 @@ class RegisterController extends Controller {
'password' => $password,
'additional_hint' => $additional_hint,
], 'guest');
if ($this->loginFlowService->isUsingLoginFlow(1)) {
$csp = new ContentSecurityPolicy();
$csp->addAllowedFormActionDomain('nc://*');
$response->setContentSecurityPolicy($csp);
}
return $response;
}
/**