Correctly handle the autologin key if a member is duplicated (see #5945)