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 {
241
241
val rest = RestTemplate()
242
242
rest.interceptors.add(ClientHttpRequestInterceptor { request, body, execution ->
243
243
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)
246
246
}
247
247
248
- if (authentication!! .credentials !is AbstractOAuth2Token) {
249
- execution.execute(request, body)
248
+ if (authentication.credentials !is AbstractOAuth2Token) {
249
+ return execution.execute(request, body)
250
250
}
251
251
252
- val token: AbstractOAuth2Token = authentication.credentials as AbstractOAuth2Token
253
- request.headers.setBearerAuth(token.tokenValue)
252
+ request.headers.setBearerAuth(authentication.credentials.tokenValue)
254
253
execution.execute(request, body)
255
254
})
256
255
return rest
You can’t perform that action at this time.
0 commit comments