Skip to content

Commit 32ed968

Browse files
authored
chore: remove remnants of selvbetjening-idtoken cookie (#306)
1 parent b7fbaa8 commit 32ed968

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/main/kotlin/no/nav/syfo/application/Authentication.kt

+2-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fun Application.setupAuth(jwkProviderTokenX: JwkProvider, tokenXIssuer: String,
2929
when {
3030
harDineSykmeldteBackendAudience(
3131
credentials,
32-
env.dineSykmeldteBackendTokenXClientId
32+
env.dineSykmeldteBackendTokenXClientId,
3333
) && erNiva4(credentials) -> {
3434
val principal = JWTPrincipal(credentials.payload)
3535
BrukerPrincipal(
@@ -44,12 +44,7 @@ fun Application.setupAuth(jwkProviderTokenX: JwkProvider, tokenXIssuer: String,
4444
}
4545
}
4646

47-
fun ApplicationCall.getToken(): String? {
48-
return when (val authHeader = request.header("Authorization")) {
49-
null -> request.cookies.get(name = "selvbetjening-idtoken")
50-
else -> authHeader.removePrefix("Bearer ")
51-
}
52-
}
47+
fun ApplicationCall.getToken(): String? = request.header("Authorization")?.removePrefix("Bearer ")
5348

5449
fun finnFnrFraToken(principal: JWTPrincipal): String {
5550
return if (

0 commit comments

Comments
 (0)