moved cui to before logging in post-auth to ensure cui value is generated before logging occurs