I'm creating Google Actions Builder
action console and I'm having some doubt in Account Linking
. Should be like, need to authenticate account linking based on my database
data.
Example:
While
Account Linking
if I wanted to pass a email (abc@gmail.com
), that email should be active and only on that caseAccount Linking
should be allow. So for this I want to write customNode Js
function.
So that I have used Link Type
as oAuth
and Authorization
, Token
URL I set with as my custom Node Js
functions.
My doubt:
- how to pass email id while link
Account Linking
. - After validate email how can I link account in
Google Actions Builder
.
My Node Js Code
Here I want to write function inside auth
call back function inside if(result)
.
const express = require('express');
const port = 5003;
const app = express();
app.get('/', (req, res) =>{
res.send(`Welcome to Test App Nodejs`);
})
app.get('/auth', (req, res) =>{
var email = req.query.email;
userModel.findAll({
where: {
emailId: email,
status:1
}
}).then((result) =>{
if(result){
// Allow to account link
} else{
// to return Thanks for trying to account linking
}
}).catch((err)=>{
res.send(err);
})
});
app.listen(port, (req, res)=>{
console.log(`Test App runing with ${port}`)
})