actions-on-google / assistant-conversation-nodejs

A developer friendly way to fulfill Actions SDK handlers for the Google Assistant
https://actions-on-google.github.io/assistant-conversation-nodejs
Apache License 2.0
104 stars 27 forks source link

Account Linking With Google Sign #37

Closed Asyasyarif closed 3 years ago

Asyasyarif commented 3 years ago

I've problem with Sign In With Google Account, the Conversation not asking for Login/Signin.

I'm follwing this instruction , I have a question, what can i do with "Client ID" that issued by Google to my Actions ? there is doesn't have no instruction with that Client ID.

this is what I have done : app.js

const {
  conversation,
} = require('@assistant/conversation');
const app = conversation({
  debug: true,
  clientId: 'xxxxx-25b0akb0ienv9tnb0oa570l2po16l1ca.apps.googleusercontent.com'
})

// Register handlers for Actions SDK intents

app.handle('linkAccount', async conv => {
  let payload = conv.headers.authorization;
  if (payload) {
    // Get UID for Firebase auth user using the email of the user
      const email = payload.email;
      if (!conv.user.params.uid && email) {
        try {
          conv.user.params.uid = (await auth.getUserByEmail(email)).uid;
        } catch (e) {
          if (e.code !== 'auth/user-not-found') {
            throw e;
          }
          // If the user is not found, create a new Firebase auth user
          // using the email obtained from Google Assistant
          conv.user.params.uid = (await auth.createUser({email})).uid;
        }
      }
    }
})

Heres my action builder Image

On Simulator page, I go to Settings and set to on "Simulate unverified users" and simualtor says : "Since your voice wasn’t recognized, I can’t do that right now. Check the Voice Match settings in the Google Home app.cancel account linking"

and I check on response, there is nothing mentioning about my credentials. maybe there is step that i missed ?