Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function initClient() {
- window.gapi.client.init(googleCalendarConfig)
- .then(_ => {
- console.log('init ok')
- })
- .catch(error => {
- dispatch('authenticationError', {error, note: 'Error on GAPI init.'})
- })
- }
- window.gapi.load('client', initClient)
- googleyolo.retrieve(oneTapConfig)
- .then(credential => {
- console.log('credential → ', credential)
- let token = {access_token: credential.idToken}
- window.gapi.client.setToken(token)
- })
- gapi.client.calendar.events.list({
- calendarId: "primary",
- timeMin: new Date().toISOString(),
- showDeleted: false,
- singleEvents: true,
- maxResults: 10,
- orderBy: "startTime"
- })
- {
- "error": {
- "errors": [
- {
- "domain": "global",
- "reason": "authError",
- "message": "Invalid Credentials",
- "locationType": "header",
- "location": "Authorization"
- }
- ],
- "code": 401,
- "message": "Invalid Credentials"
- }
- }
Add Comment
Please, Sign In to add comment