Adapted to CAS's new login schema