Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass ChannelHandlerContext to doAuth call #1756

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected final void channelRead0(ChannelHandlerContext ctx, FullHttpRequest req
// client auth will happen later, continue with WebSocket upgrade handshake
ctx.fireChannelRead(req.retain());
} else {
final PushUserAuth authEvent = doAuth(req);
final PushUserAuth authEvent = doAuth(req, ctx);
if (authEvent.isSuccess()) {
ctx.fireChannelRead(req.retain()); // continue with WebSocket upgrade handshake
ctx.fireUserEventTriggered(authEvent);
Expand Down Expand Up @@ -125,5 +125,5 @@ protected final Cookies parseCookies(FullHttpRequest req) {
*/
protected abstract boolean isDelayedAuth(FullHttpRequest req, ChannelHandlerContext ctx);

protected abstract PushUserAuth doAuth(FullHttpRequest req);
protected abstract PushUserAuth doAuth(FullHttpRequest req, ChannelHandlerContext ctx);
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected boolean isDelayedAuth(FullHttpRequest req, ChannelHandlerContext ctx)
}

@Override
protected PushUserAuth doAuth(FullHttpRequest req) {
protected PushUserAuth doAuth(FullHttpRequest req, ChannelHandlerContext ctx) {
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected boolean isDelayedAuth(FullHttpRequest req, ChannelHandlerContext ctx)
}

@Override
protected PushUserAuth doAuth(FullHttpRequest req) {
protected PushUserAuth doAuth(FullHttpRequest req, ChannelHandlerContext ctx) {
final Cookies cookies = parseCookies(req);
for (final Cookie c : cookies.getAll()) {
if (c.name().equals("userAuthCookie")) {
Expand Down