If you are talking about logging into rocket chat from nextcloud using the external sites app.
it can be done without redirect. you may have to adjust your X-Frame-Options to all your nextcloud domain to embed.
I.E for nginx “add_header X-Frame-Options ALLOWALL;”
This is not the best option from a security standpoint but hopefully it gets you on the right track.