hello @thelostone welcome to the community
Please review Collabora integration guide to understand how WOPI protocol works.
if you are using something like “forms based auth” in front of the applications this is not gonna work. Please use OIDC for Nextcloud login, CODE doesn’t need any login in front of it, it is secured by the aliasgroup and WOPI allow IP settings - use search both have been discussed often already