Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

This document requires 'TrustedScript' assignment. #527

Open
123roger456 opened this issue Jun 27, 2022 · 1 comment
Open

This document requires 'TrustedScript' assignment. #527

123roger456 opened this issue Jun 27, 2022 · 1 comment

Comments

@123roger456
Copy link

123roger456 commented Jun 27, 2022

This document requires 'TrustedScript' assignment.
Uncaught TypeError: Failed to execute 'setTimeout' on 'Window': This document requires 'TrustedScript' assignment.
at XMLHttpRequest.onreadystatechange (:44:15)

These are the errors that are shown in my console when I try to use this package. This error is only appearing on my chrome browser and not coming on any other.

import { GoogleLogin } from 'react-google-login'
import { gapi } from 'gapi-script';


const Auth = () => {
useEffect(() => {
    function start() {
    gapi.client.init({
    clientId : "clientId",
    scope : 'email'
    })
    };
    gapi.load('client:auth2',start);
    });

  const googleSuccess = async (res) => {
    console.log(res)
  }
  const googleFailure = async (err) => {
    console.log(err)
  }
return (
 <GoogleLogin 
                clientId='clientId'
            onSuccess={googleSuccess}
            onFailure={googleFailure}
                render={(renderProps) => (
              <Button className={classes.googleButton} color="primary" fullWidth onClick={renderProps.onClick} disabled={renderProps.disabled} startIcon={<Icon />} variant="contained">
                Google Sign In
              </Button>
            )}
            cookiePolicy={'single_host_origin'}
            />
)
}

export default Auth

Please help me here. Anyone who helps me will be widely appreciated among all those who have encountered this same error.

@roman-hrybinchuk
Copy link

I have the same issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants