Skip to content

Commit

Permalink
#1759 Fix user deduplication checks
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jan 22, 2021
1 parent 9b6d825 commit 69b951d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions thehive/app/org/thp/thehive/services/UserSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ class UserSrv @Inject() (

val userAttachmentSrv = new EdgeSrv[UserAttachment, User, Attachment]

override def createEntity(e: User)(implicit graph: Graph, authContext: AuthContext): Try[User with Entity] = {
integrityCheckActor ! EntityAdded("User")
super.createEntity(e)
}

def checkUser(user: User): Try[User] = {
val login =
if (!user.login.contains('@') && defaultUserDomain.isDefined) s"${user.login}@${defaultUserDomain.get}".toLowerCase
Expand All @@ -64,6 +59,7 @@ class UserSrv @Inject() (
roleSrv.create(user, organisation, profile)
else
Success(())).flatMap { _ =>
integrityCheckActor ! EntityAdded("User")
for {
richUser <- get(user).richUser(authContext, organisation._id).getOrFail("User")
_ <- auditSrv.user.create(user, richUser.toJson)
Expand Down

0 comments on commit 69b951d

Please sign in to comment.