Hello.
Welcome to the Microsoft Community.
From what you're describing, it seems you're in a loop where SharePoint requests a verification code, but after entering it and selecting "Done", you're redirected back to the login screen without processing.
This behavior can sometimes be related to Authentication issues in the browser, session cookies, or configuration settings with your organization's security policies. To assist you better, could you please confirm this:
Are you accessing SharePoint through a personal or corporate device? If is a corporate device, have you contacted your company's IT Team to look at it?
Have you tried using a different browser or clearing cache and cookies?
Are you the admin of your MS365 account, or is this managed by an IT department?
Additionally, if you're able to, please try accessing SharePoint using InPrivate or incognito browser window or form another device altogether to see if the behavior changes.
I'll be looking forward to your answer.
Best Regards,
Daniel Coy
Microsoft Community Support
Support Hours: Monday to Friday 7:30–17:30 EST (Except US Public Holidays)
Estimated Response Time: Within 1 Business day.