Add route to handle user login. Moved password check to helper function.