actions-on-google / dialogflow-helper-intents-nodejs

Helper Intents sample (using Dialogflow) in Node.js
Apache License 2.0
13 stars 8 forks source link

signIn status is "ERROR" #10

Open digj opened 5 years ago

digj commented 5 years ago

I got this sample code from the docs of actions on google account linking. The signin.status is always "ERROR". I have tried on actions console simulator, google assistant app on my phone and on a google homew mini with personal results on. But the result is the same in all cases.

const express = require('express');
const bodyParser = require('body-parser');

const {actionssdk, SignIn} = require('actions-on-google');
const app = actionssdk({
  // REPLACE THE PLACEHOLDER WITH THE CLIENT_ID OF YOUR ACTIONS PROJECT
  clientId: <client_id>,
});

// Intent that starts the account linking flow.
app.intent('actions.intent.MAIN', (conv) => {
  conv.ask(new SignIn('To get your account details'));
});
// Create an Actions SDK intent with the `actions_intent_SIGN_IN` event.
app.intent('actions.intent.SIGN_IN', (conv, params, signin) => {
    console.log(signin)
  if (signin.status === 'OK') {
    const payload = conv.user.profile.payload;
    conv.ask(`I got your account details, ${payload.name}. What do you want to do next?`);
  } else {
    conv.ask(`I won't be able to save your data, but what do you want to do next?`);
  }
});

app.intent('actions.intent.TEXT', (conv) => {
    conv.close("bye");
})

//Run server
const expressApp = express().use(bodyParser.json());
expressApp.post('/', function(req,res){
    app(req,res);
});
expressApp.listen(8080,() => {console.log("listening")});

This is the signin object I'm being returned { '@type': 'type.googleapis.com/google.actions.v2.SignInValue', status: 'ERROR' }

Can someone help me with this?

Fleker commented 4 years ago

Can you check whether your account is being labeled as a 'guest'?

https://developers.google.com/assistant/conversational/save-data#determining_and_handling_user_verification_status

digj commented 4 years ago

The account is labeled as 'verified'.