react-google-login icon indicating copy to clipboard operation
react-google-login copied to clipboard

403: Request had insufficient authentication scopes.

Open pguardiario opened this issue 3 years ago • 0 comments

Does anyone know what scopes I need to access this api endpoint? https://gmail.googleapis.com/gmail/v1/users/{userId}/messages

const login = useGoogleLogin({
    onSuccess: async codeResponse => {
      let {code} = codeResponse
      const {data} = await axios.post('http://localhost:3000/auth/google', {
        code,
      });
      setAccessToken(data.access_token)
    },
    flow: 'auth-code',
    scope: "???",
});

Also how I can get userId for the oauth user. Thanks.

pguardiario avatar Nov 03 '22 03:11 pguardiario