Skip to content

Commit

Permalink
Dedup example in doc
Browse files Browse the repository at this point in the history
See #2642

Signed-off-by: Thomas Segismont <[email protected]>
  • Loading branch information
tsegismont committed Sep 3, 2024
1 parent 7df5347 commit 53acdc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions vertx-web/src/main/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ This allows to control the state before completing the response like:

[source,$lang]
----
{@link examples.WebExamples#example78}
{@link examples.WebExamples#exampleSessionFlushOperation}
----

Vert.x Session Handler state by default uses a cookie to store session ID. Session ID is a unique string, used to
Expand Down Expand Up @@ -1374,7 +1374,7 @@ Complex chaining is also possible, for example, building logic sequences such as

[source,$lang]
----
{@link examples.WebExamples#example78}
{@link examples.WebExamples#exampleChainAuthHandler}
----

=== Impersonation
Expand Down
4 changes: 2 additions & 2 deletions vertx-web/src/main/java/examples/WebExamples.java
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,7 @@ public void example77(Vertx vertx, Router router) {
router.allowForward(AllowForwardHeaders.NONE);
}

public void example78(Router router, AuthenticationHandler authNHandlerA, AuthenticationHandler authNHandlerB, AuthenticationHandler authNHandlerC) {
public void exampleChainAuthHandler(Router router, AuthenticationHandler authNHandlerA, AuthenticationHandler authNHandlerB, AuthenticationHandler authNHandlerC) {

// Chain will verify (A Or (B And C))
ChainAuthHandler chain =
Expand All @@ -1835,7 +1835,7 @@ public void example78(Router router, AuthenticationHandler authNHandlerA, Authen
});
}

public void example78(Router router, SessionHandler sessionHandler) {
public void exampleSessionFlushOperation(Router router, SessionHandler sessionHandler) {

router.route().handler(ctx -> sessionHandler.flush(ctx)
.onSuccess(v -> ctx.end("Success!"))
Expand Down

0 comments on commit 53acdc7

Please sign in to comment.