@Override public void onLoginSuccess(Request request, Response response, Authentication authc) { if(authc instanceof TokenAuthentication) { return; } if(null == authc.getToken()){ String token = tokenAuthenticator.generateAuthenticationToken(request, response, authc); authc.setToken(token); } setCookie(request, response, authc.getToken()); }