Skip to content

Commit

Permalink
serialiserbart
Browse files Browse the repository at this point in the history
  • Loading branch information
heyvard committed Jan 13, 2025
1 parent 698c802 commit bed4fa0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/kotlin/no/nav/helse/flex/api/TestController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package no.nav.helse.flex.api
import jakarta.servlet.http.HttpServletResponse
import no.nav.helse.flex.arkivering.PdfSkaperen
import no.nav.helse.flex.config.EnvironmentToggles
import no.nav.security.token.support.client.core.oauth2.OAuth2AccessTokenResponse
import no.nav.security.token.support.client.core.oauth2.OAuth2AccessTokenService
import no.nav.security.token.support.client.spring.ClientConfigurationProperties
import no.nav.security.token.support.core.api.Unprotected
Expand Down Expand Up @@ -45,10 +44,13 @@ class TestController(

@ResponseBody
@GetMapping(value = ["/token"], produces = [MediaType.TEXT_HTML_VALUE])
fun hentHtml(): OAuth2AccessTokenResponse {
return oAuth2AccessTokenService.getAccessToken(
clientConfigurationProperties.registration.get("spinnsyn-frontend-arkivering-credentials")!!,
)
fun hentHtml(): Pair<String?, Int?> {
val accessToken =
oAuth2AccessTokenService.getAccessToken(
clientConfigurationProperties.registration.get("spinnsyn-frontend-arkivering-credentials")!!,
)

return Pair(accessToken.access_token, accessToken.expires_in)
}

@ResponseBody
Expand Down

0 comments on commit bed4fa0

Please sign in to comment.