Answer the question
In order to leave comments, you need to log in
One time link to node js?
Hello! There is a task to implement getting a private registration link through a telegram bot!
I did the following for testing:
bot.on('message', (msg) => {
const chatId = msg.chat.id;
bot.sendMessage(chatId, `http://localhost:${process.env.PORT}/signup/bot_${link}`);
// создание тестового хеша для ссылки
const link = Math.random();
// роут для регистрации
app.post(`/signup/bot_${link}`, () => {
console.log('View')
});
});
Answer the question
In order to leave comments, you need to log in
Generate a unique link, write it to the database, delete it after use.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question