I want to have a login button in my website so when a user clicks on it, the user can use their Google credentials. I\'d like to ideally perform the authentication server si
Your authentication should be done server side. Here is how it works.
fetch or axios call to your authentication route.clientSecret. If you were to store this on the frontend, it would make it really easy for someone to find that value and compromise your website.Here is an example of what that looks like with Passport.js: https://github.com/jaredhanson/passport-google-oauth2
EDIT #1:
Here is an example with comments of the process in use with Facebook, which is the same OAuth codebase: https://github.com/passport/express-4.x-facebook-example/blob/master/server.js