Skip to content

Commit

Permalink
Pretend that users' emails are verified if emailVerification is deact… (
Browse files Browse the repository at this point in the history
#7621)

* Pretend that users' emails are verified if emailVerification is deactivated

* changelog

* fix
  • Loading branch information
normanrz committed Feb 14, 2024
1 parent 1d93c37 commit 8761637
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
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

0 comments on commit 8761637

Please sign in to comment.