Skip to content

Fix: correctly set user in RoutingContext by casting userContext to UserContextInternal#313

Merged
leleuj merged 1 commit intopac4j:masterfrom
assouktim:fix/vertx-setuser-cast
Nov 6, 2025
Merged

Fix: correctly set user in RoutingContext by casting userContext to UserContextInternal#313
leleuj merged 1 commit intopac4j:masterfrom
assouktim:fix/vertx-setuser-cast

Conversation

@assouktim
Copy link
Contributor

Previously, the code incorrectly cast routingContext.user() to UserContextInternal, which would fail because user() returns a User, not the internal UserContext. This fix casts routingContext.userContext() instead, allowing setUser() to work for TockUser and other auth providers.

…serContextInternal

Previously, the code incorrectly cast routingContext.user() to UserContextInternal, which
would fail because user() returns a User, not the internal UserContext. This fix casts
routingContext.userContext() instead, allowing setUser() to work for TockUser and
other auth providers.
@assouktim assouktim marked this pull request as draft October 17, 2025 13:43
@assouktim assouktim marked this pull request as ready for review October 17, 2025 13:48
@assouktim assouktim marked this pull request as draft October 17, 2025 14:03
@leleuj
Copy link
Member

leleuj commented Oct 20, 2025

What exception do you get?

@assouktim
Copy link
Contributor Author

java.lang.ClassCastException: class ai.tock.shared.security.TockUser cannot be cast to class io.vertx.ext.web.impl.UserContextInternal

related PR on Tock : theopenconversationkit/tock#1939

@assouktim assouktim marked this pull request as ready for review November 5, 2025 13:58
@leleuj leleuj merged commit 5c5efaa into pac4j:master Nov 6, 2025
2 checks passed
@leleuj
Copy link
Member

leleuj commented Nov 6, 2025

I will cut a v7.0.2 release soon.

@leleuj
Copy link
Member

leleuj commented Nov 7, 2025

The v7.0.2 has been released: it will show up very soon in the Maven central repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants