refactored authentication; resetting passwords partially implemented