Skip to content

Commit

Permalink
✨ feat(Oauth2SuccessHandler.java): Update exception handling for au…
Browse files Browse the repository at this point in the history
…thentication token validation.
  • Loading branch information
vnobo committed Dec 18, 2024
1 parent 29c7ab7 commit 0d395f3
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.List;

import static com.plate.boot.config.SessionConfiguration.XML_HTTP_REQUEST;
import static com.plate.boot.config.SessionConfiguration.X_REQUESTED_WITH;

Expand Down Expand Up @@ -66,8 +64,9 @@ public class Oauth2SuccessHandler extends RedirectServerAuthenticationSuccessHan
@Override
public Mono<Void> onAuthenticationSuccess(WebFilterExchange webFilterExchange, Authentication authentication) {
if (!(authentication instanceof OAuth2AuthenticationToken)) {
throw RestServerException.withMsg("Authentication token must be an instance of OAuth2AuthenticationToken",
List.of());
throw RestServerException.withMsg(
"Authentication token must be an instance of OAuth2AuthenticationToken",
new TypeNotPresentException("OAuth2AuthenticationToken", null));
}

ServerWebExchange exchange = webFilterExchange.getExchange();
Expand Down

0 comments on commit 0d395f3

Please sign in to comment.