Applied after_login function.