Hi @Patryk
Welcome to Q&A forum and thanks for post your question here!
In fact, I also have the same questions a few days before and we stuck in login loop when using Teams web client. Here is our solution for this issue for your reference. It looks the same as yours.
1) Go to settings > Privacy and security > Cookies and other site data and we add the Sites [*.]teams.microsoft.com in Always clear cookies when windows are closed.
2)Close the browser and type teams.microsoft.com and you should login the account and it could work normally.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.