refactor password routes and redirect users to their location after resetting passwords