File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
docs/modules/ROOT/pages/servlet/oauth2/resource-server Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -241,16 +241,15 @@ fun rest(): RestTemplate {
241241 val rest = RestTemplate()
242242 rest.interceptors.add(ClientHttpRequestInterceptor { request, body, execution ->
243243 val authentication: Authentication? = SecurityContextHolder.getContext().authentication
244- if (authentication ! = null) {
245- execution.execute(request, body)
244+ if (authentication = = null) {
245+ return execution.execute(request, body)
246246 }
247247
248- if (authentication!! .credentials !is AbstractOAuth2Token) {
249- execution.execute(request, body)
248+ if (authentication.credentials !is AbstractOAuth2Token) {
249+ return execution.execute(request, body)
250250 }
251251
252- val token: AbstractOAuth2Token = authentication.credentials as AbstractOAuth2Token
253- request.headers.setBearerAuth(token.tokenValue)
252+ request.headers.setBearerAuth(authentication.credentials.tokenValue)
254253 execution.execute(request, body)
255254 })
256255 return rest
You can’t perform that action at this time.
0 commit comments