Skip to content

Commit 2b54006

Browse files
committed
Hente alle–varsler-endepuunkt bak tokenX
1 parent 5e26a92 commit 2b54006

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/kotlin/no/nav/tms/varsel/api/varsel/varselRoutes.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import io.ktor.server.routing.post
1111
import io.ktor.util.pipeline.PipelineContext
1212
import kotlinx.serialization.Serializable
1313
import no.nav.tms.token.support.idporten.sidecar.user.IdportenUserFactory
14-
14+
import no.nav.tms.token.support.tokenx.validation.user.TokenXUser
15+
import no.nav.tms.token.support.tokenx.validation.user.TokenXUserFactory
1516

1617
fun Route.varsel(
1718
varselConsumer: VarselConsumer
@@ -36,7 +37,7 @@ fun Route.varsel(
3637

3738
get("alle"){
3839
varselConsumer.getAlleVarsler(
39-
userToken = call.userToken,
40+
userToken = call.tokenXUser.tokenString,
4041
preferertSpraak = call.request.preferertSpraak
4142
).let { alleVarsler ->
4243
call.respond(HttpStatusCode.OK, alleVarsler)
@@ -66,6 +67,8 @@ fun Route.varsel(
6667
}
6768

6869
private val ApplicationCall.userToken get() = IdportenUserFactory.createIdportenUser(this).tokenString
70+
private val ApplicationCall.tokenXUser get() = TokenXUserFactory.createTokenXUser(this)
71+
6972

7073
@Serializable
7174
data class AntallVarsler(val beskjeder: Int, val oppgaver: Int, val innbokser: Int)

0 commit comments

Comments
 (0)