Clean code

This commit is contained in:
2020-01-28 22:35:50 +01:00
parent 813d6857e9
commit 41a98f23b8
24 changed files with 169 additions and 69 deletions

View File

@@ -17,7 +17,8 @@ val ApplicationCall.citizen: CitizenEntity
get() = attributes.computeIfAbsent(citizenAttributeKey) {
runBlocking {
val user = authentication.principal<UserI>() ?: throw ForbiddenException()
GlobalContext.get().koin.get<CitizenRepository>().findByUser(user) ?: throw ForbiddenException("Citizen not found for this user id \"${user.id}\"")
GlobalContext.get().koin.get<CitizenRepository>().findByUser(user)
?: throw ForbiddenException("Citizen not found for this user id \"${user.id}\"")
}
}