Rewrote register method to automatically login teacher after completing registration.