mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Better logging in oidc flows
This commit is contained in:
@ -111,15 +111,19 @@ object CodeFlow {
|
|||||||
token <- r.attemptAs[AccessToken].value
|
token <- r.attemptAs[AccessToken].value
|
||||||
_ <- token match {
|
_ <- token match {
|
||||||
case Right(t) =>
|
case Right(t) =>
|
||||||
logger.trace(s"Got token response: $t")
|
logger.trace(s"Got token response (status=${r.status.code}): $t")
|
||||||
case Left(err) =>
|
case Left(err) =>
|
||||||
logger.error(err)(s"Error decoding access token: ${err.getMessage}")
|
logger.error(err)(
|
||||||
|
s"Error decoding access token (status=${r.status.code}): ${err.getMessage}"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} yield token.toOption
|
} yield token.toOption
|
||||||
case r =>
|
case r =>
|
||||||
logger
|
for {
|
||||||
.error(s"Error obtaining access token '${r.status.code}' / ${r.as[String]}")
|
body <- r.bodyText.compile.string
|
||||||
.map(_ => None)
|
_ <- logger
|
||||||
|
.error(s"Error obtaining access token status=${r.status.code}, body=$body")
|
||||||
|
} yield None
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,5 +181,4 @@ object CodeFlow {
|
|||||||
logAction = Some((msg: String) => logger.trace(msg))
|
logAction = Some((msg: String) => logger.trace(msg))
|
||||||
)(c)
|
)(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user