Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretend that users' emails are verified if emailVerification is deact… #7621

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Datasets stored in WKW format are no longer loaded with memory mapping, reducing memory demands. [#7528](https://github.com/scalableminds/webknossos/pull/7528)
- Content Security Policy (CSP) settings are now relaxed by default. To keep stricter CSP rules, add them to your specific `application.conf`. [#7589](https://github.com/scalableminds/webknossos/pull/7589)
- WEBKNOSSOS now uses Java 21. [#7599](https://github.com/scalableminds/webknossos/pull/7599)
- Email verification is disabled by default. To enable it, set `webKnossos.emailVerification.activated` to `true` in your `application.conf`. [#7620](https://github.com/scalableminds/webknossos/pull/7620)
- Email verification is disabled by default. To enable it, set `webKnossos.user.emailVerification.activated` to `true` in your `application.conf`. [#7620](https://github.com/scalableminds/webknossos/pull/7620) [#7621](https://github.com/scalableminds/webknossos/pull/7621)
- Added more documentation for N5 and Neuroglancer precomputed web upload. [#7622](https://github.com/scalableminds/webknossos/pull/7622)


### Fixed
- Fixed rare SIGBUS crashes of the datastore module that were caused by memory mapping on unstable file systems. [#7528](https://github.com/scalableminds/webknossos/pull/7528)
- Fixed loading local datasets for organizations that have spaces in their names. [#7593](https://github.com/scalableminds/webknossos/pull/7593)
Expand Down
2 changes: 1 addition & 1 deletion MIGRATIONS.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ UPDATE webknossos.annotations_ SET state = 'Finished' WHERE _id IN (SELECT DIST
```
- WEBKNOSSOS now uses Java 21 (up from Java 11). [#7599](https://github.com/scalableminds/webknossos/pull/7599)
- NodeJS version 18+ is required for snapshot tests with ShadowDOM elements from Antd v5. [#7522](https://github.com/scalableminds/webknossos/pull/7522)
- Email verification is disabled by default. To enable it, set `webKnossos.emailVerification.activated` to `true` in your `application.conf`. [#7620](https://github.com/scalableminds/webknossos/pull/7620)
- Email verification is disabled by default. To enable it, set `webKnossos.user.emailVerification.activated` to `true` in your `application.conf`. [#7620](https://github.com/scalableminds/webknossos/pull/7620) [#7621](https://github.com/scalableminds/webknossos/pull/7621)

### Postgres Evolutions:

Expand Down
23 changes: 11 additions & 12 deletions app/models/user/UserService.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
package models.user

import org.apache.pekko.actor.ActorSystem
import play.silhouette.api.LoginInfo
import play.silhouette.api.services.IdentityService
import play.silhouette.api.util.PasswordInfo
import play.silhouette.impl.providers.CredentialsProvider
import com.scalableminds.util.accesscontext.{DBAccessContext, GlobalAccessContext}
import com.scalableminds.util.cache.AlfuCache
import com.scalableminds.util.security.SCrypt
Expand All @@ -15,18 +10,22 @@ import com.scalableminds.webknossos.datastore.models.datasource.LayerViewConfigu
import com.typesafe.scalalogging.LazyLogging
import mail.{DefaultMails, Send}
import models.dataset.DatasetDAO
import models.team._
import play.api.i18n.{Messages, MessagesProvider}
import play.api.libs.json._
import utils.{ObjectId, WkConf}

import javax.inject.Inject
import models.organization.OrganizationDAO
import models.team._
import net.liftweb.common.Box.tryo
import net.liftweb.common.{Box, Full}
import org.apache.pekko.actor.ActorSystem
import play.api.i18n.{Messages, MessagesProvider}
import play.api.libs.json._
import play.silhouette.api.LoginInfo
import play.silhouette.api.services.IdentityService
import play.silhouette.api.util.PasswordInfo
import play.silhouette.impl.providers.CredentialsProvider
import security.{PasswordHasher, TokenDAO}
import utils.sql.SqlEscaping
import utils.{ObjectId, WkConf}

import javax.inject.Inject
import scala.concurrent.{ExecutionContext, Future}

class UserService @Inject()(conf: WkConf,
Expand Down Expand Up @@ -367,7 +366,7 @@ class UserService @Inject()(conf: WkConf,
"created" -> user.created,
"lastTaskTypeId" -> user.lastTaskTypeId.map(_.toString),
"isSuperUser" -> multiUser.isSuperUser,
"isEmailVerified" -> multiUser.isEmailVerified,
"isEmailVerified" -> (multiUser.isEmailVerified || !conf.WebKnossos.User.EmailVerification.activated),
)
}
}
Expand Down