Update dependencies

Fix for koin 3.0
This commit is contained in:
2021-04-16 14:53:27 +02:00
parent cb9bd0c14b
commit 59c050d14d
21 changed files with 252 additions and 223 deletions

View File

@@ -17,13 +17,13 @@ private val citizenAttributeKey = AttributeKey<CitizenEntity>("CitizenContext")
val ApplicationCall.citizen: CitizenEntity
get() = attributes.computeIfAbsent(citizenAttributeKey) {
val user = authentication.principal<UserI>() ?: throw ForbiddenException("No User Connected")
GlobalContext.get().koin.get<CitizenRepository>().findByUser(user)
GlobalContext.get().get<CitizenRepository>().findByUser(user)
?: throw ForbiddenException("Citizen not found for this user id \"${user.id}\"")
}
val ApplicationCall.citizenOrNull: CitizenEntity?
get() = authentication.principal<UserI>()?.let {
GlobalContext.get().koin.get<CitizenRepository>().findByUser(it)
GlobalContext.get().get<CitizenRepository>().findByUser(it)
}
val ApplicationCall.isAuth: Boolean