I could not figure out how to implement Google Signin in our backend API.
User signup and login happens here and this is where the Google Sign In happens.
So far, this is what I've implemented
exports.googleSignin = (req, res) => { firebase .auth().signInWithPopup(provider) .then((result) => { // This gives you a Google Access Token. You can use it to access the Google API. var token = result.credential.accessToken; // The signed-in user info. var user = result.user; // console.log(user); //TODO: maybe try using login() and pass the user object? return res.status(201).json({ token }); }) .catch(console.error("Well, F")) };
But throws an unexpected error when I send a POST request using POSTMAN to test the API.
I found this in the official documentation but couldn't find anything useful.
Can someone help me implement this?