Skip to content

Commit

Permalink
enable captcha filter.
Browse files Browse the repository at this point in the history
  • Loading branch information
vnobo committed Nov 3, 2023
1 parent 53b556a commit ced15a7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.springframework.security.web.server.authorization.ServerAccessDeniedHandler;
import org.springframework.security.web.server.util.matcher.PathPatternParserServerWebExchangeMatcher;
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilter;
Expand All @@ -24,13 +25,13 @@
/**
* @author <a href="https://github.com/vnobo">Alex bob</a>
*/
@Component
public class CaptchaFilter implements WebFilter, Ordered {
public static final ServerWebExchangeMatcher DEFAULT_CAPTCHA_MATCHER =
new PathPatternParserServerWebExchangeMatcher("/oauth2/token");

private final ServerAccessDeniedHandler accessDeniedHandler = new CaptchaServerAccessDeniedHandler(
HttpStatus.FORBIDDEN);

private final ServerWebExchangeMatcher requireCaptchaProtectionMatcher = DEFAULT_CAPTCHA_MATCHER;
private final CaptchaRepository captchaTokenRepository;

Expand Down

0 comments on commit ced15a7

Please sign in to comment.