My question is, is getActiveOrganization somehow an already made function? It seems to not exist and not work, so would I have to to create this function myself?
And what benefits would I get from doing it as DB hooks instead of adding it to my login flow code? Thi seems to take in session.userId so presumably I'd have to write all the code I'd need to write anywhere else to set an active org.