I just wrote this in React using Google's OAuth API as a CodeSandbox App, you can give it a try if you want: React App (bol7p.csb.app)
I haven't put a ton of effort into it and it may not work. If it does awesome, if it doesn't, back to the drawing board. I'm not willing to logout and test it...