That’s good you found out and everything is OK now, I think.
The solution is to sign in using an App password
An App Password is a 16-digit passcode that gives a non-Google app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.
More info can be found in