I guess you do not need anymore the test (null!==$token) below. And then you can re-introduce the BEFORE_TOKEN_CONSUME event