You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{gapi}from'gapi-script';importoauth2Keysfrom'./oauthKeys.json';constAPIKEYS=oauth2Keys.web;constDISCOVERY_DOCS=['https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest'];constSCOPES=["https://www.googleapis.com/auth/youtube.readonly","https://www.googleapis.com/auth/youtube"];//im building a vuejs3 applicationmounted(){gapi.load('client:auth2',this.initClient);},data(){return{GOOGLEAUTH: null}},
methods: {initClient(){varself=this;console.log("initialising client...");gapi.client.init({discoveryDocs: DISCOVERY_DOCS,clientId: APIKEYS.client_id,scope: SCOPES}).then(function(){console.log(self);//listen for sign-in state changesself.GOOGLEAUTH=gapi.auth2.getAuthInstance();console.log("googleauth is....");console.log(self.GOOGLEAUTH);self.GOOGLEAUTH.isSignedIn.listen(self.updateSigninStatus);// Handle initial sign-in state. (Determine if user is already signed in.)self.updateSigninStatus(self.GOOGLEAUTH.currentUser.get());});}}
Console logs in the promise callbacks not running. this.GOOGLEAUTH returning undefined in subsequent code. If I remove the clientid and scope params, the console logs run but this.GOOGLEAUTH still returning undefined.
The text was updated successfully, but these errors were encountered:
Thanks for the issue report. We do not support using the linked module to load GAPI since it is a snapshot of the GAPI loading code which appears to be at least 8 months old at this point which results in loading old versions of the libraries. Please use officially documented methods of loading the libraries and try your use case again(samples: https://github.com/google/google-api-javascript-client/blob/master/docs/samples.md)
Possible duplicate here.
importing gapi as object using this script
Console logs in the promise callbacks not running. this.GOOGLEAUTH returning undefined in subsequent code. If I remove the clientid and scope params, the console logs run but this.GOOGLEAUTH still returning undefined.
The text was updated successfully, but these errors were encountered: