Skip to content

Commit 0416a07

Browse files
committed
Debug.
1 parent 29a9099 commit 0416a07

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ class VarselConsumer(
5353
preferertSpraak?.let { parameter("preferert_spraak", it) }
5454
}.body()
5555
}
56+
57+
suspend fun tokenX(userToken: String): String {
58+
return tokendingsService.exchangeToken(userToken, varselAuthorityClientId)
59+
}
5660
}
5761

5862
object VarselAuthority {

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import io.ktor.http.HttpStatusCode
44
import io.ktor.server.application.ApplicationCall
55
import io.ktor.server.application.call
66
import io.ktor.server.request.*
7-
import io.ktor.server.response.respond
7+
import io.ktor.server.response.*
88
import io.ktor.server.routing.Route
99
import io.ktor.server.routing.get
1010
import io.ktor.server.routing.post
@@ -48,6 +48,15 @@ fun Route.varsel(
4848
}
4949
}
5050

51+
get("/idtoken") {
52+
call.respondText(call.userToken)
53+
}
54+
55+
56+
get("/tokenx") {
57+
call.respondText(varselConsumer.tokenX(call.userToken))
58+
}
59+
5160

5261
post("beskjed/inaktiver") {
5362
varselConsumer.postInaktiver(varselId = call.varselId(), userToken = call.userToken)

0 commit comments

Comments
 (0)