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' }
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.
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?