I don't think you need to change your password at this point since you said "no." But, what you saw probably was a server location error. See See the following from Two-factor authentication for Apple ID https://support.apple.com/en-us/HT204915
When you sign in on a new device, you’ll get a notification on your other trusted devices that includes a map showing the approximate location of the new device. This is an approximate location based on the IP address the device is currently using, rather than the exact location of the device. The location shown might reflect the network you're connected to, and not your physical location.
If you know you’re the person trying to sign in but you don’t recognize the location shown, you can still tap Allow and continue signing in. However, if you ever see a notification that your Apple ID is being used to sign in on a new device and you're not the one signing in, tap Don’t Allow to block the sign in attempt.
So, of course, you did exactly the right thing even though there may not have been a problem.