Skip to content

Commit

Permalink
#2127 Accept array of string from OpenID Connect
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jul 19, 2021
1 parent d80e3f7 commit 4e83e34
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion thehive/app/org/thp/thehive/services/LocalUserSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ class LocalUserSrv @Inject() (
val defaultProfile = configuration.getOptional[String]("user.defaults.profile")
val defaultOrg = configuration.getOptional[String]("user.defaults.organisation")
def readData(json: JsObject, field: Option[String], default: Option[String]): Try[String] =
Try((json \ field.get).as[String]).orElse(Try(default.get))
Try((json \ field.get).as[String])
.orElse(Try((json \ field.get).as[Seq[String]].head))
.orElse(Try(default.get))

db.tryTransaction { implicit graph =>
implicit val defaultAuthContext: AuthContext = getSystemAuthContext
Expand Down

0 comments on commit 4e83e34

Please sign in to comment.