Skip to content

Commit

Permalink
Pass ChannelHandlerContext to doAuth call (#1756)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyagna authored and argha-c committed Sep 9, 2024
1 parent 66e6cb9 commit b4fc2cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit b4fc2cc

Please sign in to comment.