in app/controllers/PasskeyAuthFilter.scala [77:99]
private def extractAuthenticationData[A](request: UserIdentityRequest[A]) = {
def createMissingBodyError(username: String): JanusException =
JanusException(
userMessage = "Missing authentication credentials",
engineerMessage =
s"Authentication request for user '$username' is missing required credentials",
httpCode = BAD_REQUEST,
causedBy = None
)
for {
body <- request.body match {
case AnyContentAsFormUrlEncoded(data) =>
data
.get("credentials")
.flatMap(_.headOption)
.toRight(createMissingBodyError(request.user.username))
.toTry
case _ => Failure(createMissingBodyError(request.user.username))
}
authData <- Passkey.parsedAuthentication(body)
} yield authData
}