diff --git a/app/controllers/AuthenticationController.scala b/app/controllers/AuthenticationController.scala index 81afb6d735..3a8620a23d 100755 --- a/app/controllers/AuthenticationController.scala +++ b/app/controllers/AuthenticationController.scala @@ -621,8 +621,8 @@ class AuthenticationController @Inject()( dataStoreToken <- bearerTokenAuthenticatorService.createAndInitDataStoreTokenForUser(user) _ <- organizationService .createOrganizationDirectory(organization._id, dataStoreToken) ?~> "organization.folderCreation.failed" - _ <- Fox.runOptional(signUpData.acceptedTermsOfService)(version => - acceptTermsOfServiceForUser(user, version)) + _ <- Fox.runIf(conf.WebKnossos.TermsOfService.enabled)( + acceptTermsOfServiceForUser(user, signUpData.acceptedTermsOfService)) } yield { Mailer ! Send(defaultMails .newOrganizationMail(organization.name, email, request.headers.get("Host").getOrElse(""))) @@ -639,8 +639,12 @@ class AuthenticationController @Inject()( ) } - private def acceptTermsOfServiceForUser(user: User, termsOfServiceVersion: Int)(implicit m: MessagesProvider) = - organizationService.acceptTermsOfService(user._organization, termsOfServiceVersion)(DBAccessContext(Some(user)), m) + private def acceptTermsOfServiceForUser(user: User, termsOfServiceVersion: Option[Int])( + implicit m: MessagesProvider): Fox[Unit] = + for { + acceptedVersion <- Fox.option2Fox(termsOfServiceVersion) + _ <- organizationService.acceptTermsOfService(user._organization, acceptedVersion)(DBAccessContext(Some(user)), m) + } yield () case class CreateUserInOrganizationParameters(firstName: String, lastName: String, diff --git a/conf/application.conf b/conf/application.conf index dd13a75721..a626e2bad6 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -117,7 +117,7 @@ webKnossos { """ termsOfService { enabled = true - # The URL will be embedded into an iFrame + # The URL will be linked to or embedded into an iFrame url = "https://webknossos.org/terms-of-service" acceptanceDeadline = "2023-01-01T00:00:00Z" version = 1