Skip to content

Commit

Permalink
Hotfix: Handle missing mail attribute for user.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarvelle committed Apr 17, 2024
1 parent c9a13a4 commit 66040f8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ case class FeideExtendedUserInfo(
eduPersonAffiliation: Seq[String],
eduPersonPrimaryAffiliation: Option[String],
eduPersonPrincipalName: String,
mail: Seq[String]
mail: Option[Seq[String]]
) {

private def isTeacherAffiliation: Boolean = {
Expand All @@ -74,7 +74,7 @@ case class FeideExtendedUserInfo(
}
}

def email: String = this.mail.headOption.getOrElse(this.eduPersonPrincipalName)
def email: String = this.mail.getOrElse(Seq(this.eduPersonPrincipalName)).head
def username: String = this.eduPersonPrincipalName
}

Expand Down

0 comments on commit 66040f8

Please sign in to comment.