Skip to content

Commit 65513f2

Browse files
committed
Polish OAuth2AuthorizedClientArgumentResolver
1 parent 80f256e commit 65513f2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/reactive/result/method/annotation/OAuth2AuthorizedClientArgumentResolver.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,11 @@ private Mono<OAuth2AuthorizeRequest> authorizeRequest(String registrationId, Ser
137137
.switchIfEmpty(currentServerWebExchange());
138138

139139
return Mono.zip(defaultedRegistrationId, defaultedAuthentication, defaultedExchange)
140-
.map(t3 -> {
141-
OAuth2AuthorizeRequest.Builder builder = OAuth2AuthorizeRequest.withClientRegistrationId(t3.getT1()).principal(t3.getT2());
142-
if (t3.getT3() != null) {
143-
builder.attribute(ServerWebExchange.class.getName(), t3.getT3());
144-
}
145-
return builder.build();
146-
});
140+
.map(t3 -> OAuth2AuthorizeRequest.withClientRegistrationId(t3.getT1())
141+
.principal(t3.getT2())
142+
.attribute(ServerWebExchange.class.getName(), t3.getT3())
143+
.build()
144+
);
147145
}
148146

149147
private Mono<Authentication> currentAuthentication() {

0 commit comments

Comments
 (0)