Idea for this is by EA117: https://area51.phpbb.com/phpBB/viewtopic.php?f=81&t=67071&p=325671#p325616
Start using the S_LOGIN_REDIRECT template variable that is already included on all login forms to output the S_FORM_TOKEN_LOGIN. This will ensure compatibility with older styles (pre phpBB 3.2.6).