In my app, a user can log in with their Gmail and write in-app messages which basically trigger a Gmail to another user. For such a system, should I have the client-side javascript do the authentication with google servers and communication with the Gmail api or should I have my web server be a middleman?