I don't use this kind of language often.Well it works at least!
But what the fudge.
I thought I tried a try catch before this. I must not have.
I was hoping there'd be some error code that would be caught, instead it works perfectly. The function now works perfectly with the passed in data. It doesn't catch any error, it just tries and succeeds.
I'm literally shaking. I'm not sure if I'm happy or pissed right now.
Google sign in now works front end and back end.