Since your code doesn't write the authors to the file it already requires that the authors are given before `\maketitle`, so then it's also reasonable to require affiliations there. Then you get something like https://gist.github.com/zauguin/19bf1bc9128a8abaedfe3081717b... which doesn't need a file.
Hello, I thought about it a little and indeed you are both right! For the sake of completeness I've updated beamleeto to use this mechanism instead :) thank you for your help!