Too many redirects error

So, I am new to Okta and I build the most simple ever Spring Boot app and included Okta. I followed the tutorials and guides and I successfully got it running and created some users but when I try to login (this happens only when credentials are correct) I get this too many redirects error (when it is supposed to access the endpoint).
I am aware that this question has been asked many times and I tried everything but it just won’t resolve. Would really appreciate if someone may know why is this happening.