I am doing azure ad authentication in my node js bot. in the last step it is showing a pop windows with magic code. I want to close that magic window pop up automatically after 5 sec.
this is code
res.send('Welcome ' + req.user.displayName + '! Please copy this number and paste it back to your chat so your authentication can complete: ' + magicCode);
this line send a window pop with magic code. iwant to close this window after 5 sec automatically. my code
server.get('/api/OAuthCallback/',
passport.authenticate('azuread-openidconnect', { failureRedirect: '/login' }),
(req, res) => {
console.log('OAuthCallback');
console.log(req);
const address = JSON.parse(req.query.state);
const magicCode = crypto.randomBytes(4).toString('hex');
const messageData = { magicCode: magicCode, accessToken: req.user.accessToken, refreshToken: req.user.refreshToken, userId: address.user.id, name: req.user.displayName, email: req.user.preferred_username };
magicNum = magicCode;
var continueMsg = new builder.Message().address(address).text(JSON.stringify(messageData));
console.log(continueMsg.toMessage());
test_name = JSON.parse(req.user._raw).preferred_username.split("@")[0]
bot.receive(continueMsg.toMessage());
res.send('Sign-in successful');
}
);
Thanks in advance