Jonas Bark
08/07/2019, 10:56 AMreqeust.awaitPrincipal()
always returns null.
I'm using coRouter and all I do is:
suspend fun categoriesGet(request: ServerRequest): ServerResponse {
val principal = request.awaitPrincipal()
println("PRINCIP: $principal")
}
when I use the standard-non-coroutine router I'm getting the expected result:
fun hello(request: ServerRequest): Mono<ServerResponse> {
return request.principal()
.map { it.name }
.flatMap { userName ->
ok().contentType(MediaType.APPLICATION_JSON)
.syncBody("Hello $userName")
}
}
is this a bug?